home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Newton / Programming / Newt-Slurpee / Life 1.2.sit / life.nwt < prev   
MacBinary  |  1994-11-12  |  19.4 KB  |  [TEXT/R*ch]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: life.nwt

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Nov 12 07:53:41 1994, modified Sat Nov 12 07:53:41 1994, creator BBEdit, type ASCII, 18883 bytes "life.nwt" , at 0x4a43 670 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[R*ch]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 6c 69 66 65 2e 6e | 77 74 00 00 00 00 00 00 |..life.n|wt......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 52 2a 63 | 68 01 00 00 00 00 00 00 |.TEXTR*c|h.......|
|00000050| 00 00 00 00 00 49 c3 00 | 00 02 9e aa ea 6b 55 aa |.....I..|.....kU.|
|00000060| ea 6b 55 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.kU.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 25 99 00 00 |........|....%...|
|00000080| 4e 6f 74 65 73 0d 7b 6c | 61 62 65 6c 73 3a 20 27 |Notes.{l|abels: '|
|00000090| 4e 49 4c 2c 20 76 69 65 | 77 46 6f 6e 74 3a 20 31 |NIL, vie|wFont: 1|
|000000a0| 30 32 34 31 7d 20 2f 2f | 20 6e 69 6c 3d 55 6e 66 |0241} //| nil=Unf|
|000000b0| 69 6c 65 64 2c 20 6f 72 | 20 73 70 65 63 69 66 79 |iled, or| specify|
|000000c0| 20 61 20 66 6f 6c 64 65 | 72 2c 20 65 2e 67 2e 2c | a folde|r, e.g.,|
|000000d0| 20 27 42 75 73 69 6e 65 | 73 73 2e 20 20 72 65 6d | 'Busine|ss. rem|
|000000e0| 6f 76 65 20 76 69 65 77 | 46 6f 6e 74 20 66 6f 72 |ove view|Font for|
|000000f0| 20 63 75 72 72 65 6e 74 | 20 53 74 79 6c 65 73 20 | current| Styles |
|00000100| 64 65 66 61 75 6c 74 0d | 2f 2f 45 52 41 53 45 21 |default.|//ERASE!|
|00000110| 20 72 65 6d 6f 76 65 20 | 69 6e 69 74 69 61 6c 20 | remove |initial |
|00000120| 2f 2f 20 74 6f 20 65 72 | 61 73 65 20 65 78 69 73 |// to er|ase exis|
|00000130| 74 69 6e 67 20 65 6e 74 | 72 69 65 73 20 69 6e 20 |ting ent|ries in |
|00000140| 74 68 69 73 20 66 6f 6c | 64 65 72 20 66 69 72 73 |this fol|der firs|
|00000150| 74 0d 0d 6c 69 66 65 2e | 6e 77 74 20 2d 2d 20 53 |t..life.|nwt -- S|
|00000160| 6c 75 72 70 65 65 20 66 | 6f 72 6d 61 74 0d 31 31 |lurpee f|ormat.11|
|00000170| 2f 31 32 2f 39 34 0d 43 | 6f 70 79 72 69 67 68 74 |/12/94.C|opyright|
|00000180| 20 31 39 39 34 20 53 2e | 20 57 65 79 65 72 2e 20 | 1994 S.| Weyer. |
|00000190| 20 41 6c 6c 20 52 69 67 | 68 74 73 20 52 65 73 65 | All Rig|hts Rese|
|000001a0| 72 76 65 64 20 57 6f 72 | 6c 64 77 69 64 65 2e 0d |rved Wor|ldwide..|
|000001b0| 0d 4b 65 79 77 6f 72 64 | 73 3a 20 4c 69 66 65 2c |.Keyword|s: Life,|
|000001c0| 20 63 65 6c 6c 75 6c 61 | 72 20 61 75 74 6f 6d 61 | cellula|r automa|
|000001d0| 74 61 2c 20 6d 61 74 68 | 65 6d 61 74 69 63 61 6c |ta, math|ematical|
|000001e0| 20 73 69 6d 75 6c 61 74 | 69 6f 6e 2c 20 43 6f 6e | simulat|ion, Con|
|000001f0| 77 61 79 0d 0d 54 68 69 | 73 20 4e 65 77 74 20 73 |way..Thi|s Newt s|
|00000200| 6f 75 72 63 65 20 76 65 | 72 73 69 6f 6e 20 6f 66 |ource ve|rsion of|
|00000210| 20 22 74 68 65 20 67 61 | 6d 65 20 6f 66 20 4c 69 | "the ga|me of Li|
|00000220| 66 65 22 20 61 6e 64 20 | 61 73 73 6f 63 69 61 74 |fe" and |associat|
|00000230| 65 64 20 4e 54 4b 20 70 | 61 63 6b 61 67 65 73 20 |ed NTK p|ackages |
|00000240| 61 72 65 0d 66 72 65 65 | 77 61 72 65 20 61 6e 64 |are.free|ware and|
|00000250| 20 6d 61 79 20 62 65 20 | 64 69 73 74 72 69 62 75 | may be |distribu|
|00000260| 74 65 64 20 66 72 65 65 | 6c 79 20 61 73 20 6c 6f |ted free|ly as lo|
|00000270| 6e 67 20 61 73 20 74 68 | 65 20 66 69 6c 65 73 20 |ng as th|e files |
|00000280| 22 6c 69 66 65 2e 6e 77 | 74 22 20 69 73 0d 69 6e |"life.nw|t" is.in|
|00000290| 63 6c 75 64 65 64 20 61 | 6e 64 20 75 6e 6d 6f 64 |cluded a|nd unmod|
|000002a0| 69 66 69 65 64 2e 20 20 | 59 6f 75 20 61 72 65 20 |ified. |You are |
|000002b0| 66 72 65 65 20 74 6f 20 | 6d 61 6b 65 20 6d 6f 64 |free to |make mod|
|000002c0| 69 66 69 63 61 74 69 6f | 6e 73 20 66 6f 72 20 79 |ificatio|ns for y|
|000002d0| 6f 75 72 20 6f 77 6e 0d | 75 73 65 2e 0d 0d 43 6f |our own.|use...Co|
|000002e0| 6e 74 65 6e 74 73 3a 0d | 2d 20 6c 69 66 65 2d 31 |ntents:.|- life-1|
|000002f0| 32 2e 70 6b 67 20 20 2d | 2d 20 67 65 6e 65 72 61 |2.pkg -|- genera|
|00000300| 6c 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |l implem|entation|
|00000310| 20 28 4c 69 66 65 20 31 | 2e 32 29 0d 2d 20 6c 69 | (Life 1|.2).- li|
|00000320| 66 65 2d 31 32 62 2e 70 | 6b 67 20 2d 2d 20 61 20 |fe-12b.p|kg -- a |
|00000330| 6d 6f 72 65 20 6f 70 74 | 69 6d 69 7a 65 64 20 28 |more opt|imized (|
|00000340| 62 69 74 6d 61 70 2d 62 | 61 73 65 64 29 20 76 65 |bitmap-b|ased) ve|
|00000350| 72 73 69 6f 6e 20 28 4c | 69 66 65 20 31 2e 32 42 |rsion (L|ife 1.2B|
|00000360| 29 0d 2d 20 6c 69 66 65 | 2e 6e 77 74 20 2d 2d 20 |).- life|.nwt -- |
|00000370| 4e 65 77 74 20 73 6f 75 | 72 63 65 20 66 6f 72 20 |Newt sou|rce for |
|00000380| 4c 69 66 65 20 31 2e 32 | 20 5b 74 68 69 73 20 66 |Life 1.2| [this f|
|00000390| 69 6c 65 5d 0d 28 4d 61 | 63 20 66 6f 72 6d 61 74 |ile].(Ma|c format|
|000003a0| 20 74 65 78 74 20 66 69 | 6c 65 20 69 6e 20 2e 73 | text fi|le in .s|
|000003b0| 69 74 2f 2e 68 71 78 20 | 61 72 63 68 69 76 65 73 |it/.hqx |archives|
|000003c0| 3b 20 44 4f 53 20 74 65 | 78 74 20 69 6e 20 2e 7a |; DOS te|xt in .z|
|000003d0| 69 70 20 61 72 63 68 69 | 76 65 29 0d 2d 2d 2d 2d |ip archi|ve).----|
|000003e0| 2d 2d 2d 2d 2d 2d 0d 44 | 65 76 65 6c 6f 70 6d 65 |------.D|evelopme|
|000003f0| 6e 74 20 61 6e 64 20 22 | 4e 65 77 74 22 0d 0d 49 |nt and "|Newt"..I|
|00000400| 66 20 79 6f 75 20 77 6f | 75 6c 64 20 6c 69 6b 65 |f you wo|uld like|
|00000410| 20 74 6f 20 63 6f 6e 73 | 74 72 75 63 74 20 61 6e | to cons|truct an|
|00000420| 64 20 6d 6f 64 69 66 79 | 20 4c 69 66 65 20 64 69 |d modify| Life di|
|00000430| 72 65 63 74 6c 79 20 6f | 6e 20 79 6f 75 72 20 4e |rectly o|n your N|
|00000440| 65 77 74 6f 6e 2c 20 6f | 62 74 61 69 6e 0d 74 68 |ewton, o|btain.th|
|00000450| 65 20 6c 61 74 65 73 74 | 20 76 65 72 73 69 6f 6e |e latest| version|
|00000460| 20 6f 66 20 22 4e 65 77 | 74 22 20 28 6e 65 77 74 | of "New|t" (newt|
|00000470| 2d 64 65 76 65 6e 76 2d | 32 34 29 2c 20 74 68 65 |-devenv-|24), the|
|00000480| 20 6e 61 74 69 76 65 20 | 4e 65 77 74 6f 6e 20 64 | native |Newton d|
|00000490| 65 76 65 6c 6f 70 6d 65 | 6e 74 0d 65 6e 76 69 72 |evelopme|nt.envir|
|000004a0| 6f 6e 6d 65 6e 74 20 28 | 73 68 61 72 65 77 61 72 |onment (|sharewar|
|000004b0| 65 29 2c 20 61 6e 64 20 | 22 53 6c 75 72 70 65 65 |e), and |"Slurpee|
|000004c0| 22 20 28 73 6c 75 72 70 | 65 65 2d 31 32 29 20 61 |" (slurp|ee-12) a|
|000004d0| 20 74 65 78 74 2f 64 61 | 74 61 20 74 72 61 6e 73 | text/da|ta trans|
|000004e0| 66 65 72 0d 75 74 69 6c | 69 74 79 20 28 66 72 65 |fer.util|ity (fre|
|000004f0| 65 77 61 72 65 29 20 66 | 72 6f 6d 20 79 6f 75 72 |eware) f|rom your|
|00000500| 20 66 61 76 6f 72 69 74 | 65 20 4e 65 77 74 6f 6e | favorit|e Newton|
|00000510| 20 73 65 72 76 65 72 2f | 61 72 63 68 69 76 65 20 | server/|archive |
|00000520| 28 69 6e 74 65 72 6e 65 | 74 20 28 75 69 6f 77 61 |(interne|t (uiowa|
|00000530| 2c 0d 61 6d 75 67 2c 2e | 2e 2e 29 2c 20 41 4f 4c |,.amug,.|..), AOL|
|00000540| 2c 20 43 6f 6d 70 75 73 | 65 72 76 65 2c 20 65 57 |, Compus|erve, eW|
|00000550| 6f 72 6c 64 29 2e 20 53 | 65 65 20 22 44 65 76 65 |orld). S|ee "Deve|
|00000560| 6c 6f 70 22 20 61 6e 64 | 20 22 41 75 74 68 6f 72 |lop" and| "Author|
|00000570| 22 20 68 65 6c 70 20 70 | 61 67 65 73 2e 0d 43 6f |" help p|ages..Co|
|00000580| 6e 74 61 63 74 20 6d 65 | 20 69 66 20 79 6f 75 20 |ntact me| if you |
|00000590| 68 61 76 65 20 74 72 6f | 75 62 6c 65 20 66 69 6e |have tro|uble fin|
|000005a0| 64 69 6e 67 20 4e 65 77 | 74 2c 20 75 73 69 6e 67 |ding New|t, using|
|000005b0| 20 69 74 20 69 6e 69 74 | 69 61 6c 6c 79 2c 20 6f | it init|ially, o|
|000005c0| 72 20 68 61 76 65 0d 71 | 75 65 73 74 69 6f 6e 73 |r have.q|uestions|
|000005d0| 20 61 62 6f 75 74 20 72 | 65 67 69 73 74 65 72 69 | about r|egisteri|
|000005e0| 6e 67 20 69 74 2e 20 20 | 28 41 6e 20 69 6e 74 65 |ng it. |(An inte|
|000005f0| 72 65 73 74 69 6e 67 20 | 6e 6f 74 65 3a 20 49 20 |resting |note: I |
|00000600| 64 65 76 65 6c 6f 70 65 | 64 20 74 68 65 73 65 0d |develope|d these.|
|00000610| 76 65 72 73 69 6f 6e 73 | 20 66 69 72 73 74 20 75 |versions| first u|
|00000620| 73 69 6e 67 20 4e 65 77 | 74 2c 20 74 68 65 6e 20 |sing New|t, then |
|00000630| 63 72 65 61 74 65 64 20 | 74 68 65 20 4e 54 4b 20 |created |the NTK |
|00000640| 76 65 72 73 69 6f 6e 73 | 29 2e 0d 0d 52 65 67 69 |versions|)...Regi|
|00000650| 73 74 65 72 65 64 20 4e | 65 77 74 20 75 73 65 72 |stered N|ewt user|
|00000660| 73 20 72 65 63 65 69 76 | 65 20 61 6e 20 69 6e 74 |s receiv|e an int|
|00000670| 72 6f 64 75 63 74 6f 72 | 79 20 6d 61 6e 75 61 6c |roductor|y manual|
|00000680| 20 61 6e 64 20 66 6c 6f | 70 70 79 20 6f 66 20 73 | and flo|ppy of s|
|00000690| 65 76 65 72 61 6c 0d 64 | 6f 7a 65 6e 20 65 78 61 |everal.d|ozen exa|
|000006a0| 6d 70 6c 65 73 2c 20 69 | 6e 63 6c 75 64 69 6e 67 |mples, i|ncluding|
|000006b0| 20 73 65 76 65 72 61 6c | 20 76 65 72 73 69 6f 6e | several| version|
|000006c0| 73 20 6f 66 20 4c 69 66 | 65 3a 0d 2d 20 6c 69 66 |s of Lif|e:.- lif|
|000006d0| 65 2e 6e 77 74 20 20 20 | 28 73 6f 75 72 63 65 20 |e.nwt |(source |
|000006e0| 66 6f 72 20 4c 69 66 65 | 20 31 2e 32 29 20 5b 73 |for Life| 1.2) [s|
|000006f0| 61 6d 65 20 61 73 20 74 | 68 69 73 20 66 69 6c 65 |ame as t|his file|
|00000700| 5d 0d 2d 20 6c 69 66 65 | 62 31 2e 6e 77 74 20 28 |].- life|b1.nwt (|
|00000710| 73 6f 75 72 63 65 20 66 | 6f 72 20 4c 69 66 65 20 |source f|or Life |
|00000720| 31 2e 32 42 29 0d 2d 20 | 6c 69 66 65 62 30 2e 6e |1.2B).- |lifeb0.n|
|00000730| 77 74 20 28 61 6e 20 65 | 61 72 6c 79 2c 20 6d 6f |wt (an e|arly, mo|
|00000740| 72 65 20 72 65 61 64 61 | 62 6c 65 20 62 75 74 20 |re reada|ble but |
|00000750| 6d 75 63 68 20 73 6c 6f | 77 65 72 20 76 65 72 73 |much slo|wer vers|
|00000760| 69 6f 6e 20 6f 66 20 4c | 69 66 65 20 31 2e 32 42 |ion of L|ife 1.2B|
|00000770| 29 0d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 52 65 76 |).------|----.Rev|
|00000780| 69 73 69 6f 6e 20 48 69 | 73 74 6f 72 79 3a 0d 0d |ision Hi|story:..|
|00000790| 4c 69 66 65 20 31 2e 32 | 42 20 28 31 31 2f 31 32 |Life 1.2|B (11/12|
|000007a0| 2f 39 34 29 0d 2d 20 70 | 72 6f 76 69 64 65 73 20 |/94).- p|rovides |
|000007b0| 73 63 72 75 62 20 67 65 | 73 74 75 72 65 20 66 6f |scrub ge|sture fo|
|000007c0| 72 20 63 6c 65 61 72 0d | 2d 20 61 6c 6c 6f 77 73 |r clear.|- allows|
|000007d0| 20 67 72 69 64 20 73 69 | 7a 65 20 74 6f 20 62 65 | grid si|ze to be|
|000007e0| 20 73 65 6c 65 63 74 65 | 64 20 62 79 20 75 73 65 | selecte|d by use|
|000007f0| 72 0d 2d 20 75 73 65 73 | 20 61 6c 6c 20 76 69 73 |r.- uses| all vis|
|00000800| 69 62 6c 65 20 63 65 6c | 6c 73 20 28 31 2e 32 20 |ible cel|ls (1.2 |
|00000810| 64 6f 65 73 20 6e 6f 74 | 20 75 73 65 20 66 69 72 |does not| use fir|
|00000820| 73 74 26 6c 61 73 74 20 | 72 6f 77 26 63 6f 6c 29 |st&last |row&col)|
|00000830| 0d 2d 20 67 65 6e 65 72 | 61 74 65 73 20 66 61 73 |.- gener|ates fas|
|00000840| 74 65 72 20 28 31 2e 35 | 20 2d 20 33 2e 35 78 20 |ter (1.5| - 3.5x |
|00000850| 4c 69 66 65 20 31 2e 32 | 29 20 61 6e 64 20 61 6c |Life 1.2|) and al|
|00000860| 6c 6f 77 73 20 6c 61 72 | 67 65 72 20 67 72 69 64 |lows lar|ger grid|
|00000870| 73 0d 20 20 62 79 20 75 | 73 69 6e 67 20 61 20 62 |s. by u|sing a b|
|00000880| 69 74 6d 61 70 20 64 61 | 74 61 20 73 74 72 75 63 |itmap da|ta struc|
|00000890| 74 75 72 65 20 66 6f 72 | 20 73 74 6f 72 61 67 65 |ture for| storage|
|000008a0| 20 61 6e 64 20 64 72 61 | 77 69 6e 67 0d 0d 4c 69 | and dra|wing..Li|
|000008b0| 66 65 20 31 2e 32 20 28 | 31 31 2f 31 32 2f 39 34 |fe 1.2 (|11/12/94|
|000008c0| 29 0d 2d 20 6d 6f 64 69 | 66 69 65 73 20 73 79 6d |).- modi|fies sym|
|000008d0| 62 6f 6c 20 6e 61 6d 65 | 73 2f 70 72 6f 67 72 61 |bol name|s/progra|
|000008e0| 6d 20 73 74 72 75 63 74 | 75 72 65 20 74 6f 20 62 |m struct|ure to b|
|000008f0| 65 20 6d 6f 72 65 20 63 | 6f 6e 73 69 73 74 65 6e |e more c|onsisten|
|00000900| 74 20 77 69 74 68 20 31 | 2e 32 42 0d 2d 20 66 69 |t with 1|.2B.- fi|
|00000910| 78 65 73 20 62 75 74 74 | 6f 6e 20 68 69 67 68 6c |xes butt|on highl|
|00000920| 69 67 68 74 69 6e 67 20 | 67 6c 69 74 63 68 20 28 |ighting |glitch (|
|00000930| 73 69 62 6c 69 6e 67 20 | 6f 72 64 65 72 29 0d 0d |sibling |order)..|
|00000940| 4c 69 66 65 20 31 2e 31 | 20 28 31 30 2f 31 35 2f |Life 1.1| (10/15/|
|00000950| 39 34 29 0d 2d 20 75 73 | 65 73 20 30 2f 31 20 66 |94).- us|es 0/1 f|
|00000960| 6f 72 20 63 65 6c 6c 20 | 76 61 6c 75 65 73 20 72 |or cell |values r|
|00000970| 61 74 68 65 72 20 74 68 | 61 6e 20 6e 69 6c 2f 74 |ather th|an nil/t|
|00000980| 72 75 65 0d 2d 20 61 6c | 6c 6f 77 73 20 70 61 74 |rue.- al|lows pat|
|00000990| 74 65 72 6e 73 20 74 6f | 20 62 65 20 73 65 6c 65 |terns to| be sele|
|000009a0| 63 74 65 64 2f 61 64 64 | 65 64 0d 2d 20 61 64 64 |cted/add|ed.- add|
|000009b0| 73 20 61 20 67 72 69 64 | 20 28 77 68 65 6e 20 73 |s a grid| (when s|
|000009c0| 74 6f 70 70 65 64 29 0d | 0d 4c 69 66 65 20 31 2e |topped).|.Life 1.|
|000009d0| 30 20 28 39 2f 31 38 2f | 39 34 29 0d 2d 20 61 64 |0 (9/18/|94).- ad|
|000009e0| 64 73 20 61 20 22 43 6c | 65 61 72 22 20 61 6e 64 |ds a "Cl|ear" and|
|000009f0| 20 22 4e 65 78 74 22 20 | 62 75 74 74 6f 6e 0d 2d | "Next" |button.-|
|00000a00| 20 61 64 64 73 20 61 20 | 67 65 6e 65 72 61 74 69 | adds a |generati|
|00000a10| 6f 6e 20 63 6f 75 6e 74 | 65 72 2e 0d 2d 20 61 64 |on count|er..- ad|
|00000a20| 64 73 20 61 20 22 52 65 | 70 65 61 74 22 20 62 75 |ds a "Re|peat" bu|
|00000a30| 74 74 6f 6e 20 2d 2d 20 | 77 68 69 63 68 20 69 6e |tton -- |which in|
|00000a40| 76 6f 6b 65 73 20 22 4e | 65 78 74 22 20 69 6e 20 |vokes "N|ext" in |
|00000a50| 74 68 65 20 62 61 63 6b | 67 72 6f 75 6e 64 20 75 |the back|ground u|
|00000a60| 6e 74 69 6c 0d 20 20 79 | 6f 75 20 74 61 70 20 22 |ntil. y|ou tap "|
|00000a70| 53 74 6f 70 22 20 28 6f | 72 20 61 6c 6c 20 63 65 |Stop" (o|r all ce|
|00000a80| 6c 6c 73 20 61 72 65 20 | 65 6d 70 74 79 29 0d 2d |lls are |empty).-|
|00000a90| 20 61 64 64 73 20 61 6e | 20 22 49 6e 66 6f 22 20 | adds an| "Info" |
|00000aa0| 62 75 74 74 6f 6e 20 61 | 6e 64 20 68 65 6c 70 20 |button a|nd help |
|00000ab0| 62 6f 6f 6b 0d 2d 20 61 | 76 6f 69 64 73 20 61 6c |book.- a|voids al|
|00000ac0| 6c 6f 63 61 74 69 6e 67 | 2f 65 78 61 6d 69 6e 69 |locating|/examini|
|00000ad0| 6e 67 20 65 6d 70 74 79 | 20 72 6f 77 73 2f 63 6f |ng empty| rows/co|
|00000ae0| 6c 75 6d 6e 73 20 77 68 | 65 72 65 20 70 6f 73 73 |lumns wh|ere poss|
|00000af0| 69 62 6c 65 20 74 6f 0d | 20 20 69 6d 70 72 6f 76 |ible to.| improv|
|00000b00| 65 20 73 70 65 65 64 20 | 64 72 61 77 69 6e 67 20 |e speed |drawing |
|00000b10| 61 6e 64 20 67 65 6e 65 | 72 61 74 69 6e 67 0d 0d |and gene|rating..|
|00000b20| 4c 69 66 65 20 22 30 2e | 31 22 20 28 33 2f 39 34 |Life "0.|1" (3/94|
|00000b30| 29 0d 2d 20 73 65 65 20 | 22 4c 69 66 65 20 77 69 |).- see |"Life wi|
|00000b40| 74 68 20 4e 65 77 74 6f | 6e 53 63 72 69 70 74 22 |th Newto|nScript"|
|00000b50| 20 62 79 20 44 61 76 69 | 64 20 42 65 74 7a 20 69 | by Davi|d Betz i|
|00000b60| 6e 20 42 79 74 65 2c 20 | 4d 61 72 63 68 20 31 39 |n Byte, |March 19|
|00000b70| 39 34 2c 20 70 70 2e 20 | 31 39 31 2d 31 39 34 2e |94, pp. |191-194.|
|00000b80| 0d 20 20 54 68 69 73 20 | 61 72 74 69 63 6c 65 20 |. This |article |
|00000b90| 70 72 6f 76 69 64 65 64 | 20 69 6e 73 70 69 72 61 |provided| inspira|
|00000ba0| 74 69 6f 6e 2c 20 61 6e | 20 69 6e 69 74 69 61 6c |tion, an| initial|
|00000bb0| 20 66 72 61 6d 65 77 6f | 72 6b 20 61 6e 64 20 61 | framewo|rk and a|
|00000bc0| 20 66 65 77 20 6d 61 69 | 6e 20 6d 65 74 68 6f 64 | few mai|n method|
|00000bd0| 73 2e 0d 0d 54 68 65 73 | 65 20 76 65 72 73 69 6f |s...Thes|e versio|
|00000be0| 6e 73 20 61 72 65 20 71 | 75 69 74 65 20 75 73 61 |ns are q|uite usa|
|00000bf0| 62 6c 65 20 66 6f 72 20 | 73 6d 61 6c 6c 20 70 61 |ble for |small pa|
|00000c00| 74 74 65 72 6e 73 2c 20 | 62 75 74 20 6e 6f 74 20 |tterns, |but not |
|00000c10| 62 6c 69 6e 64 69 6e 67 | 6c 79 20 66 61 73 74 0d |blinding|ly fast.|
|00000c20| 66 6f 72 20 6d 6f 72 65 | 20 73 70 61 72 73 65 20 |for more| sparse |
|00000c30| 6f 72 20 73 70 72 65 61 | 64 6f 75 74 20 70 61 74 |or sprea|dout pat|
|00000c40| 74 65 72 6e 73 20 28 74 | 68 6f 75 67 68 20 4c 69 |terns (t|hough Li|
|00000c50| 66 65 20 31 2e 32 42 20 | 68 61 6e 64 6c 65 73 0d |fe 1.2B |handles.|
|00000c60| 6c 61 72 67 65 72 2f 73 | 70 61 72 73 65 72 20 70 |larger/s|parser p|
|00000c70| 61 74 74 65 72 6e 73 20 | 62 65 74 74 65 72 29 20 |atterns |better) |
|00000c80| 2d 2d 20 74 68 65 20 65 | 6d 70 68 61 73 69 73 20 |-- the e|mphasis |
|00000c90| 69 73 20 6f 6e 20 74 68 | 65 20 63 6f 6d 70 6c 65 |is on th|e comple|
|00000ca0| 74 65 0d 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 61 |te.appli|cation a|
|00000cb0| 6e 64 20 6c 65 61 72 6e | 69 6e 67 20 70 72 6f 67 |nd learn|ing prog|
|00000cc0| 72 61 6d 6d 69 6e 67 2e | 0d 0d 50 6f 73 73 69 62 |ramming.|..Possib|
|00000cd0| 6c 65 20 66 75 74 75 72 | 65 20 65 6e 68 61 6e 63 |le futur|e enhanc|
|00000ce0| 65 6d 65 6e 74 73 3a 0d | 2d 20 61 6c 6c 6f 77 20 |ements:.|- allow |
|00000cf0| 70 61 74 74 65 72 6e 73 | 20 74 6f 20 62 65 20 73 |patterns| to be s|
|00000d00| 61 76 65 64 20 69 6e 2f | 72 65 74 72 69 65 76 65 |aved in/|retrieve|
|00000d10| 64 20 66 72 6f 6d 20 61 | 20 73 6f 75 70 0d 2d 20 |d from a| soup.- |
|00000d20| 73 61 76 65 20 70 72 65 | 66 65 72 65 6e 63 65 73 |save pre|ferences|
|00000d30| 20 66 6f 72 20 67 72 69 | 64 20 73 69 7a 65 2c 20 | for gri|d size, |
|00000d40| 65 74 63 2e 0d 2d 20 72 | 65 63 6f 6d 70 69 6c 65 |etc..- r|ecompile|
|00000d50| 20 22 6e 65 78 74 47 65 | 6e 65 72 61 74 69 6f 6e | "nextGe|neration|
|00000d60| 22 20 6d 65 74 68 6f 64 | 20 77 69 74 68 20 4e 54 |" method| with NT|
|00000d70| 4b 20 52 49 53 43 20 63 | 6f 6d 70 69 6c 65 72 20 |K RISC c|ompiler |
|00000d80| 77 68 65 6e 20 61 76 61 | 69 6c 61 62 6c 65 0d 0d |when ava|ilable..|
|00000d90| 49 66 20 79 6f 75 20 77 | 6f 75 6c 64 20 6c 69 6b |If you w|ould lik|
|00000da0| 65 20 74 6f 20 65 6e 63 | 6f 75 72 61 67 65 20 6d |e to enc|ourage m|
|00000db0| 65 20 74 6f 20 64 65 76 | 65 6c 6f 70 20 61 6e 64 |e to dev|elop and|
|00000dc0| 20 64 69 73 74 72 69 62 | 75 74 65 20 74 68 69 73 | distrib|ute this|
|00000dd0| 20 61 6e 64 20 6f 74 68 | 65 72 0d 65 78 61 6d 70 | and oth|er.examp|
|00000de0| 6c 65 73 2c 20 49 20 65 | 6e 63 6f 75 72 61 67 65 |les, I e|ncourage|
|00000df0| 20 79 6f 75 20 74 6f 20 | 72 65 67 69 73 74 65 72 | you to |register|
|00000e00| 20 4e 65 77 74 20 28 6b | 69 6e 64 20 77 6f 72 64 | Newt (k|ind word|
|00000e10| 73 20 61 6c 73 6f 20 61 | 70 70 72 65 63 69 61 74 |s also a|ppreciat|
|00000e20| 65 64 29 2e 0d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |ed)..---|-------.|
|00000e30| 55 73 69 6e 67 20 4c 69 | 66 65 0d 0d 54 61 70 20 |Using Li|fe..Tap |
|00000e40| 74 68 65 20 69 6e 66 6f | 20 62 75 74 74 6f 6e 20 |the info| button |
|00000e50| 74 6f 20 61 63 63 65 73 | 73 20 74 68 65 20 62 75 |to acces|s the bu|
|00000e60| 69 6c 74 2d 69 6e 20 68 | 65 6c 70 20 62 6f 6f 6b |ilt-in h|elp book|
|00000e70| 2e 0d 0d 53 6f 6d 65 20 | 63 6c 61 73 73 69 63 20 |...Some |classic |
|00000e80| 70 61 74 74 65 72 6e 73 | 20 74 6f 20 74 72 79 20 |patterns| to try |
|00000e90| 28 73 6f 6d 65 20 69 6e | 20 70 61 74 74 65 72 6e |(some in| pattern|
|00000ea0| 20 70 69 63 6b 65 72 29 | 3a 0d 20 20 4f 4f 4f 20 | picker)|:. OOO |
|00000eb0| 20 20 20 20 28 62 6c 69 | 6e 6b 65 72 20 2d 2d 20 | (bli|nker -- |
|00000ec0| 66 6c 69 70 73 29 0d 0d | 20 20 20 4f 0d 20 20 4f |flips)..| O. O|
|00000ed0| 20 20 20 20 20 20 20 28 | 67 6c 69 64 65 72 20 2d | (|glider -|
|00000ee0| 2d 20 6d 6f 76 65 73 20 | 64 6f 77 6e 26 6c 65 66 |- moves |down&lef|
|00000ef0| 74 20 31 20 69 6e 20 34 | 20 73 74 65 70 73 29 0d |t 1 in 4| steps).|
|00000f00| 20 20 4f 4f 4f 0d 0d 20 | 20 4f 4f 0d 20 20 4f 4f | OOO.. | OO. OO|
|00000f10| 20 20 20 20 20 20 28 62 | 6c 6f 63 6b 20 2d 2d 20 | (b|lock -- |
|00000f20| 73 74 61 62 6c 65 29 0d | 0d 20 20 20 4f 4f 0d 20 |stable).|. OO. |
|00000f30| 20 4f 20 20 4f 20 20 20 | 20 28 62 65 65 68 69 76 | O O | (beehiv|
|00000f40| 65 20 2d 2d 20 73 74 61 | 62 6c 65 29 0d 20 20 20 |e -- sta|ble). |
|00000f50| 4f 4f 0d 0d 20 20 20 20 | 0d 20 20 4f 4f 4f 4f 4f |OO.. |. OOOOO|
|00000f60| 20 20 20 28 74 75 72 6e | 73 20 69 6e 74 6f 20 22 | (turn|s into "|
|00000f70| 74 72 61 66 66 69 63 20 | 6c 69 67 68 74 73 22 20 |traffic |lights" |
|00000f80| 28 34 20 62 6c 69 6e 6b | 65 72 73 29 20 69 6e 20 |(4 blink|ers) in |
|00000f90| 39 20 73 74 65 70 73 29 | 0d 0d 20 4f 4f 4f 4f 4f |9 steps)|.. OOOOO|
|00000fa0| 4f 4f 20 20 28 74 75 72 | 6e 73 20 69 6e 74 6f 20 |OO (tur|ns into |
|00000fb0| 22 68 6f 6e 65 79 20 66 | 61 72 6d 22 20 28 34 20 |"honey f|arm" (4 |
|00000fc0| 62 65 65 68 69 76 65 73 | 29 20 2e 2e 2e 29 0d 0d |beehives|) ...)..|
|00000fd0| 4f 4f 4f 4f 4f 4f 4f 4f | 4f 20 28 64 6f 75 62 6c |OOOOOOOO|O (doubl|
|00000fe0| 65 20 74 72 61 66 66 69 | 63 20 6c 69 67 68 74 73 |e traffi|c lights|
|00000ff0| 2e 2e 2e 29 0d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |...).---|-------.|
|00001000| 54 72 61 6e 73 66 65 72 | 72 69 6e 67 20 61 6e 64 |Transfer|ring and|
|00001010| 20 42 75 69 6c 64 69 6e | 67 20 4c 69 66 65 0d 0d | Buildin|g Life..|
|00001020| 55 73 65 20 79 6f 75 72 | 20 66 61 76 6f 72 69 74 |Use your| favorit|
|00001030| 65 20 74 72 61 6e 73 66 | 65 72 20 6d 65 63 68 61 |e transf|er mecha|
|00001040| 6e 69 73 6d 20 74 6f 20 | 6d 6f 76 65 20 74 68 65 |nism to |move the|
|00001050| 20 74 65 78 74 20 66 72 | 6f 6d 20 79 6f 75 72 20 | text fr|om your |
|00001060| 64 65 73 6b 74 6f 70 20 | 73 79 73 74 65 6d 0d 74 |desktop |system.t|
|00001070| 6f 20 74 68 65 20 4e 65 | 77 74 6f 6e 20 4e 6f 74 |o the Ne|wton Not|
|00001080| 65 70 61 64 2e 20 54 68 | 69 73 20 66 69 6c 65 20 |epad. Th|is file |
|00001090| 69 73 20 66 6f 72 6d 61 | 74 74 65 64 20 74 6f 20 |is forma|tted to |
|000010a0| 62 65 20 75 73 65 64 20 | 6d 6f 73 74 20 65 61 73 |be used |most eas|
|000010b0| 69 6c 79 20 77 69 74 68 | 0d 53 6c 75 72 70 65 65 |ily with|.Slurpee|
|000010c0| 2e 20 2d 2d 2d 2d 2d 20 | 64 65 6c 69 6d 69 74 73 |. ----- |delimits|
|000010d0| 20 73 65 70 61 72 61 74 | 65 20 6e 6f 74 65 73 2e | separat|e notes.|
|000010e0| 20 20 54 6f 20 73 61 76 | 65 20 6f 6e 20 4e 6f 74 | To sav|e on Not|
|000010f0| 65 70 61 64 20 73 70 61 | 63 65 2c 20 79 6f 75 20 |epad spa|ce, you |
|00001100| 6d 61 79 0d 77 69 73 68 | 20 74 6f 20 6d 61 6b 65 |may.wish| to make|
|00001110| 20 61 20 63 6f 70 79 20 | 6f 66 20 74 68 69 73 20 | a copy |of this |
|00001120| 66 69 6c 65 2c 20 61 6e | 64 20 64 65 6c 65 74 65 |file, an|d delete|
|00001130| 20 74 68 65 73 65 20 63 | 6f 6d 6d 65 6e 74 20 70 | these c|omment p|
|00001140| 61 72 61 67 72 61 70 68 | 73 20 75 70 74 6f 0d 2d |aragraph|s upto.-|
|00001150| 2d 2d 2d 2d 20 70 72 65 | 63 65 64 69 6e 67 20 22 |---- pre|ceding "|
|00001160| 4c 69 66 65 22 20 64 65 | 66 69 6e 69 74 69 6f 6e |Life" de|finition|
|00001170| 2e 0d 0d 54 6f 20 62 75 | 69 6c 64 20 74 68 65 20 |...To bu|ild the |
|00001180| 4c 69 66 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |Life app|lication|
|00001190| 2c 20 69 6e 73 74 61 6c | 6c 20 4e 65 77 74 20 28 |, instal|l Newt (|
|000011a0| 32 2e 34 20 69 73 20 74 | 68 65 20 6c 61 74 65 73 |2.4 is t|he lates|
|000011b0| 74 20 76 65 72 73 69 6f | 6e 20 61 74 20 74 69 6d |t versio|n at tim|
|000011c0| 65 0d 6f 66 20 74 68 69 | 73 20 72 65 6c 65 61 73 |e.of thi|s releas|
|000011d0| 65 29 2e 20 28 49 66 20 | 79 6f 75 20 77 6f 75 6c |e). (If |you woul|
|000011e0| 64 20 6c 69 6b 65 20 74 | 6f 20 73 61 76 65 20 74 |d like t|o save t|
|000011f0| 68 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 74 |he appli|cation t|
|00001200| 6f 20 72 75 6e 20 69 74 | 0d 73 74 61 6e 64 61 6c |o run it|.standal|
|00001210| 6f 6e 65 20 6c 61 74 65 | 72 2c 20 61 6c 73 6f 20 |one late|r, also |
|00001220| 69 6e 73 74 61 6c 6c 20 | 74 68 65 20 6d 61 74 63 |install |the matc|
|00001230| 68 69 6e 67 20 76 65 72 | 73 69 6f 6e 20 6f 66 20 |hing ver|sion of |
|00001240| 52 55 4e 65 77 74 2c 20 | 65 2e 67 2e 2c 20 32 2e |RUNewt, |e.g., 2.|
|00001250| 34 29 2e 0d 0d 53 74 61 | 72 74 20 4e 65 77 74 2c |4)...Sta|rt Newt,|
|00001260| 20 73 65 6c 65 63 74 20 | 74 68 65 20 66 6f 6c 64 | select |the fold|
|00001270| 65 72 20 61 74 20 74 6f | 70 20 77 68 65 72 65 20 |er at to|p where |
|00001280| 79 6f 75 20 73 74 6f 72 | 65 64 20 74 68 65 20 73 |you stor|ed the s|
|00001290| 6f 75 72 63 65 2e 0d 0d | 54 61 70 20 45 78 70 72 |ource...|Tap Expr|
|000012a0| 2c 20 73 65 6c 65 63 74 | 20 3a 64 6f 4f 62 6a 28 |, select| :doObj(|
|000012b0| 27 62 75 69 6c 64 2c 27 | 4c 69 66 65 29 2c 20 74 |'build,'|Life), t|
|000012c0| 61 70 20 45 76 61 6c 0d | 0d 53 6f 6d 65 20 73 69 |ap Eval.|.Some si|
|000012d0| 6d 70 6c 65 20 6d 6f 64 | 69 66 69 63 61 74 69 6f |mple mod|ificatio|
|000012e0| 6e 73 20 79 6f 75 20 6d | 69 67 68 74 20 74 72 79 |ns you m|ight try|
|000012f0| 3a 0d 2d 20 63 68 61 6e | 67 65 20 73 69 7a 65 58 |:.- chan|ge sizeX|
|00001300| 20 74 6f 20 61 20 73 6d | 61 6c 6c 65 72 20 6f 72 | to a sm|aller or|
|00001310| 20 6c 61 72 67 65 72 20 | 6e 75 6d 62 65 72 0d 2d | larger |number.-|
|00001320| 20 63 68 61 6e 67 65 20 | 4d 61 6b 65 4f 76 61 6c | change |MakeOval|
|00001330| 20 74 6f 20 4d 61 6b 65 | 52 65 63 74 20 69 6e 20 | to Make|Rect in |
|00001340| 76 69 65 77 44 72 61 77 | 53 63 72 69 70 74 0d 2d |viewDraw|Script.-|
|00001350| 20 61 64 64 20 6f 74 68 | 65 72 20 70 61 74 74 65 | add oth|er patte|
|00001360| 72 6e 73 20 69 6e 20 70 | 61 74 74 65 72 6e 50 69 |rns in p|atternPi|
|00001370| 63 6b 65 72 2e 70 61 74 | 74 65 72 6e 73 20 61 72 |cker.pat|terns ar|
|00001380| 72 61 79 20 28 61 6e 64 | 20 6e 61 6d 65 73 20 69 |ray (and| names i|
|00001390| 6e 20 6c 61 62 65 6c 43 | 6f 6d 6d 61 6e 64 73 29 |n labelC|ommands)|
|000013a0| 0d 2d 20 61 64 64 20 6f | 74 68 65 72 20 70 61 67 |.- add o|ther pag|
|000013b0| 65 73 20 74 6f 20 74 68 | 65 20 68 65 6c 70 62 6f |es to th|e helpbo|
|000013c0| 6f 6b 0d 2d 20 63 68 61 | 6e 67 65 20 74 68 65 20 |ok.- cha|nge the |
|000013d0| 72 75 6c 65 73 20 28 63 | 6f 75 6e 74 4e 65 69 67 |rules (c|ountNeig|
|000013e0| 68 62 6f 72 73 2c 20 6e | 65 78 74 47 65 6e 65 72 |hbors, n|extGener|
|000013f0| 61 74 69 6f 6e 29 0d 0d | 49 66 20 79 6f 75 20 77 |ation)..|If you w|
|00001400| 6f 75 6c 64 20 6c 69 6b | 65 20 74 6f 20 72 75 6e |ould lik|e to run|
|00001410| 20 74 68 65 20 4c 69 66 | 65 20 61 70 70 6c 69 63 | the Lif|e applic|
|00001420| 61 74 69 6f 6e 20 6c 61 | 74 65 72 20 77 69 74 68 |ation la|ter with|
|00001430| 6f 75 74 20 68 61 76 69 | 6e 67 20 74 6f 0d 72 65 |out havi|ng to.re|
|00001440| 63 6f 6d 70 69 6c 65 20 | 74 68 65 20 73 6f 75 72 |compile |the sour|
|00001450| 63 65 73 20 69 6e 20 4e | 65 77 74 2c 20 61 6e 64 |ces in N|ewt, and|
|00001460| 20 79 6f 75 20 68 61 76 | 65 20 52 55 4e 65 77 74 | you hav|e RUNewt|
|00001470| 20 69 6e 73 74 61 6c 6c | 65 64 2c 20 74 61 70 20 | install|ed, tap |
|00001480| 74 68 65 20 53 61 76 65 | 0d 62 75 74 74 6f 6e 20 |the Save|.button |
|00001490| 28 69 6e 20 45 76 61 6c | 20 43 6f 6e 74 72 6f 6c |(in Eval| Control|
|000014a0| 73 29 20 77 68 65 6e 20 | 4c 69 66 65 20 69 73 20 |s) when |Life is |
|000014b0| 6f 70 65 6e 2e 0d 0d 4e | 6f 74 65 31 3a 20 41 6c |open...N|ote1: Al|
|000014c0| 74 68 6f 75 67 68 20 79 | 6f 75 20 63 61 6e 20 64 |though y|ou can d|
|000014d0| 69 73 74 72 69 62 75 74 | 65 20 4e 65 77 74 2d 67 |istribut|e Newt-g|
|000014e0| 65 6e 65 72 61 74 65 64 | 20 61 70 70 73 20 74 6f |enerated| apps to|
|000014f0| 20 6f 74 68 65 72 20 4e | 65 77 74 6f 6e 73 20 76 | other N|ewtons v|
|00001500| 69 61 0d 62 65 61 6d 69 | 6e 67 20 6f 72 20 65 6d |ia.beami|ng or em|
|00001510| 61 69 6c 28 65 57 6f 72 | 6c 64 2f 4e 65 77 74 6f |ail(eWor|ld/Newto|
|00001520| 6e 4d 61 69 6c 29 2c 20 | 74 68 65 72 65 20 69 73 |nMail), |there is|
|00001530| 20 63 75 72 72 65 6e 74 | 6c 79 20 6e 6f 20 6d 65 | current|ly no me|
|00001540| 63 68 61 6e 69 73 6d 20 | 66 6f 72 0d 6d 61 6b 69 |chanism |for.maki|
|00001550| 6e 67 20 74 68 65 73 65 | 20 61 70 70 73 20 69 6e |ng these| apps in|
|00001560| 74 6f 20 65 78 74 65 72 | 6e 61 6c 20 22 70 61 63 |to exter|nal "pac|
|00001570| 6b 61 67 65 20 66 69 6c | 65 73 22 20 2d 2d 20 74 |kage fil|es" -- t|
|00001580| 68 75 73 2c 20 49 20 68 | 61 76 65 20 69 6e 63 6c |hus, I h|ave incl|
|00001590| 75 64 65 64 20 61 6e 0d | 4e 54 4b 2d 70 61 63 6b |uded an.|NTK-pack|
|000015a0| 61 67 65 20 76 65 72 73 | 69 6f 6e 20 28 4c 69 66 |age vers|ion (Lif|
|000015b0| 65 2d 31 32 2e 70 6b 67 | 29 20 66 6f 72 20 74 68 |e-12.pkg|) for th|
|000015c0| 6f 73 65 20 77 68 6f 20 | 77 6f 75 6c 64 20 6c 69 |ose who |would li|
|000015d0| 6b 65 20 74 6f 20 74 72 | 79 20 4c 69 66 65 0d 77 |ke to tr|y Life.w|
|000015e0| 69 74 68 6f 75 74 20 62 | 75 69 6c 64 69 6e 67 20 |ithout b|uilding |
|000015f0| 69 74 3b 20 49 20 61 6c | 73 6f 20 68 61 76 65 20 |it; I al|so have |
|00001600| 69 6e 63 6c 75 64 65 64 | 20 4c 69 66 65 2d 31 32 |included| Life-12|
|00001610| 62 2e 70 6b 67 20 73 69 | 6e 63 65 20 74 68 65 20 |b.pkg si|nce the |
|00001620| 73 6f 75 72 63 65 20 66 | 6f 72 0d 74 68 61 74 20 |source f|or.that |
|00001630| 6e 65 77 65 72 2c 20 66 | 61 73 74 65 72 20 76 65 |newer, f|aster ve|
|00001640| 72 73 69 6f 6e 20 69 73 | 20 61 76 61 69 6c 61 62 |rsion is| availab|
|00001650| 6c 65 20 6f 6e 6c 79 20 | 74 6f 20 72 65 67 69 73 |le only |to regis|
|00001660| 74 65 72 65 64 20 75 73 | 65 72 73 2e 0d 0d 4e 6f |tered us|ers...No|
|00001670| 74 65 32 3a 20 74 68 65 | 72 65 20 69 73 20 63 75 |te2: the|re is cu|
|00001680| 72 72 65 6e 74 6c 79 20 | 61 20 62 75 67 20 69 6e |rrently |a bug in|
|00001690| 20 75 73 69 6e 67 20 68 | 65 6c 70 20 62 6f 6f 6b | using h|elp book|
|000016a0| 73 20 69 6e 20 52 55 4e | 65 77 74 20 28 32 2e 34 |s in RUN|ewt (2.4|
|000016b0| 29 20 61 70 70 73 2e 0d | 2d 2d 2d 2d 2d 2d 2d 2d |) apps..|--------|
|000016c0| 2d 2d 0d 4f 62 6a 65 63 | 74 73 3a 0d 0d 4c 69 66 |--.Objec|ts:..Lif|
|000016d0| 65 20 2d 2d 20 74 68 65 | 20 61 70 70 6c 69 63 61 |e -- the| applica|
|000016e0| 74 69 6f 6e 20 28 66 6c | 6f 61 74 69 6e 67 20 76 |tion (fl|oating v|
|000016f0| 69 65 77 29 0d 20 20 5b | 73 70 6c 69 74 20 69 6e |iew). [|split in|
|00001700| 74 6f 20 73 65 76 65 72 | 61 6c 20 73 65 63 74 69 |to sever|al secti|
|00001710| 6f 6e 73 20 74 6f 20 6d | 61 6b 65 20 65 64 69 74 |ons to m|ake edit|
|00001720| 69 6e 67 20 6f 6e 20 4e | 65 77 74 6f 6e 20 6d 6f |ing on N|ewton mo|
|00001730| 72 65 20 6d 61 6e 61 67 | 65 61 62 6c 65 5d 0d 4c |re manag|eable].L|
|00001740| 69 66 65 44 72 61 77 20 | 2d 2d 20 61 6e 20 65 6d |ifeDraw |-- an em|
|00001750| 62 65 64 64 65 64 20 76 | 69 65 77 20 74 6f 20 68 |bedded v|iew to h|
|00001760| 61 6e 64 6c 65 20 64 72 | 61 77 69 6e 67 0d 74 69 |andle dr|awing.ti|
|00001770| 74 6c 65 4f 62 6a 20 2d | 2d 20 74 69 74 6c 65 20 |tleObj -|- title |
|00001780| 61 74 20 74 6f 70 20 6f | 66 20 4c 69 66 65 20 76 |at top o|f Life v|
|00001790| 69 65 77 0d 73 74 61 74 | 75 73 20 2d 2d 20 73 74 |iew.stat|us -- st|
|000017a0| 61 74 75 73 20 62 61 72 | 20 61 74 20 62 6f 74 74 |atus bar| at bott|
|000017b0| 6f 6d 20 6f 66 20 4c 69 | 66 65 20 76 69 65 77 0d |om of Li|fe view.|
|000017c0| 63 6c 65 61 72 42 75 74 | 74 6f 6e 2c 20 6e 65 78 |clearBut|ton, nex|
|000017d0| 74 42 75 74 74 6f 6e 2c | 20 72 65 70 65 61 74 42 |tButton,| repeatB|
|000017e0| 75 74 74 6f 6e 2c 20 7a | 69 6e 66 6f 42 75 74 74 |utton, z|infoButt|
|000017f0| 6f 6e 20 2d 2d 20 65 6d | 62 65 64 64 65 64 20 69 |on -- em|bedded i|
|00001800| 6e 20 73 74 61 74 75 73 | 0d 70 61 74 74 65 72 6e |n status|.pattern|
|00001810| 50 69 63 6b 65 72 20 2d | 2d 20 70 69 63 6b 65 72 |Picker -|- picker|
|00001820| 20 66 6f 72 20 73 65 6c | 65 63 74 69 6e 67 20 70 | for sel|ecting p|
|00001830| 61 74 74 65 72 6e 73 0d | 6e 75 6d 47 65 6e 20 2d |atterns.|numGen -|
|00001840| 2d 20 67 65 6e 65 72 61 | 74 69 6f 6e 20 63 6f 75 |- genera|tion cou|
|00001850| 6e 74 65 72 0d 68 65 6c | 70 42 6f 6f 6b 20 2d 2d |nter.hel|pBook --|
|00001860| 20 68 65 6c 70 20 62 6f | 6f 6b 20 64 61 74 61 20 | help bo|ok data |
|00001870| 73 74 72 75 63 74 75 72 | 65 0d 68 65 6c 70 56 69 |structur|e.helpVi|
|00001880| 65 77 20 2d 2d 20 64 79 | 6e 61 6d 69 63 20 22 54 |ew -- dy|namic "T|
|00001890| 69 6e 79 20 54 69 6d 22 | 20 68 65 6c 70 20 72 65 |iny Tim"| help re|
|000018a0| 61 64 65 72 20 76 69 65 | 77 0d 2d 2d 2d 2d 2d 2d |ader vie|w.------|
|000018b0| 2d 2d 2d 2d 0d 4c 69 66 | 65 0d 2f 2f 3a 64 6f 4f |----.Lif|e.//:doO|
|000018c0| 62 6a 28 27 62 75 69 6c | 64 2c 20 27 4c 69 66 65 |bj('buil|d, 'Life|
|000018d0| 29 0d 7b 2f 2f 20 74 68 | 65 20 6d 61 69 6e 20 4c |).{// th|e main L|
|000018e0| 69 66 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 0d |ife appl|ication.|
|000018f0| 76 69 65 77 43 6c 61 73 | 73 3a 20 27 63 6c 56 69 |viewClas|s: 'clVi|
|00001900| 65 77 2c 0d 76 69 65 77 | 42 6f 75 6e 64 73 3a 20 |ew,.view|Bounds: |
|00001910| 4e 49 4c 2c 20 20 20 20 | 2f 2f 20 63 6f 6d 70 75 |NIL, |// compu|
|00001920| 74 65 64 20 69 6e 20 76 | 69 65 77 53 65 74 75 70 |ted in v|iewSetup|
|00001930| 46 6f 72 6d 53 63 72 69 | 70 74 0d 76 69 65 77 46 |FormScri|pt.viewF|
|00001940| 6c 61 67 73 3a 20 35 2c | 20 20 20 20 20 20 20 2f |lags: 5,| /|
|00001950| 2f 20 76 56 69 73 69 62 | 6c 65 20 2b 20 76 41 70 |/ vVisib|le + vAp|
|00001960| 70 6c 69 63 61 74 69 6f | 6e 0d 76 69 65 77 46 6f |plicatio|n.viewFo|
|00001970| 72 6d 61 74 3a 20 33 33 | 37 2c 20 20 20 20 2f 2f |rmat: 33|7, //|
|00001980| 20 76 66 46 69 6c 6c 57 | 68 69 74 65 20 2b 20 76 | vfFillW|hite + v|
|00001990| 66 46 72 61 6d 65 42 6c | 61 63 6b 20 2b 20 76 66 |fFrameBl|ack + vf|
|000019a0| 50 65 6e 2a 31 2c 0d 64 | 65 63 6c 61 72 65 53 65 |Pen*1,.d|eclareSe|
|000019b0| 6c 66 3a 20 27 62 61 73 | 65 2c 20 2f 2f 20 66 6f |lf: 'bas|e, // fo|
|000019c0| 72 20 63 6c 6f 73 65 20 | 62 6f 78 0d 74 69 74 6c |r close |box.titl|
|000019d0| 65 3a 20 22 4c 69 66 65 | 22 2c 0d 0d 2f 2f 20 53 |e: "Life|",..// S|
|000019e0| 45 54 20 54 48 49 53 0d | 73 69 7a 65 58 3a 20 20 |ET THIS.|sizeX: |
|000019f0| 20 20 20 31 36 2c 20 2f | 2f 20 77 69 64 74 68 20 | 16, /|/ width |
|00001a00| 6f 66 20 75 6e 69 76 65 | 72 73 65 20 28 69 6e 20 |of unive|rse (in |
|00001a10| 65 64 69 74 61 62 6c 65 | 20 63 65 6c 6c 73 29 2e |editable| cells).|
|00001a20| 20 28 64 6f 65 73 20 6e | 6f 74 20 69 6e 63 6c 75 | (does n|ot inclu|
|00001a30| 64 65 20 31 73 74 20 26 | 20 6c 61 73 74 20 65 6d |de 1st &| last em|
|00001a40| 70 74 79 20 63 6f 6c 73 | 29 0d 0d 2f 2f 20 74 68 |pty cols|)..// th|
|00001a50| 65 73 65 20 61 72 65 20 | 63 6f 6d 70 75 74 65 64 |ese are |computed|
|00001a60| 20 66 72 6f 6d 20 73 69 | 7a 65 58 20 69 6e 20 76 | from si|zeX in v|
|00001a70| 69 65 77 53 65 74 75 70 | 46 6f 72 6d 53 63 72 69 |iewSetup|FormScri|
|00001a80| 70 74 0d 73 69 7a 65 59 | 3a 20 20 20 20 4e 49 4c |pt.sizeY|: NIL|
|00001a90| 2c 20 2f 2f 20 68 65 69 | 67 68 74 20 6f 66 20 75 |, // hei|ght of u|
|00001aa0| 6e 69 76 65 72 73 65 0d | 63 65 6c 6c 53 69 7a 65 |niverse.|cellSize|
|00001ab0| 3a 20 4e 49 4c 2c 20 2f | 2f 20 64 69 61 6d 65 74 |: NIL, /|/ diamet|
|00001ac0| 65 72 20 6f 66 20 61 20 | 63 65 6c 6c 0d 76 53 69 |er of a |cell.vSi|
|00001ad0| 7a 65 58 3a 20 20 20 4e | 49 4c 2c 20 2f 2f 20 77 |zeX: N|IL, // w|
|00001ae0| 69 64 74 68 20 6f 66 20 | 4c 69 66 65 44 72 61 77 |idth of |LifeDraw|
|00001af0| 0d 76 53 69 7a 65 59 3a | 20 20 20 4e 49 4c 2c 20 |.vSizeY:| NIL, |
|00001b00| 2f 2f 20 68 65 69 67 68 | 74 20 6f 66 20 4c 69 66 |// heigh|t of Lif|
|00001b10| 65 44 72 61 77 0d 0d 66 | 69 72 73 74 52 6f 77 3a |eDraw..f|irstRow:|
|00001b20| 20 4e 49 4c 2c 20 2f 2f | 20 74 6f 20 61 76 6f 69 | NIL, //| to avoi|
|00001b30| 64 20 64 65 61 64 20 72 | 6f 77 73 20 61 62 6f 76 |d dead r|ows abov|
|00001b40| 65 0d 6c 61 73 74 52 6f | 77 3a 20 20 4e 49 4c 2c |e.lastRo|w: NIL,|
|00001b50| 20 2f 2f 20 74 6f 20 61 | 76 6f 69 64 20 64 65 61 | // to a|void dea|
|00001b60| 64 20 72 6f 77 73 20 62 | 65 6c 6f 77 0d 66 69 72 |d rows b|elow.fir|
|00001b70| 73 74 43 6f 6c 3a 20 4e | 49 4c 2c 20 2f 2f 20 64 |stCol: N|IL, // d|
|00001b80| 69 74 74 6f 20 66 6f 72 | 20 63 6f 6c 75 6d 6e 73 |itto for| columns|
|00001b90| 0d 6c 61 73 74 43 6f 6c | 3a 20 20 4e 49 4c 2c 0d |.lastCol|: NIL,.|
|00001ba0| 75 6e 69 76 65 72 73 65 | 3a 20 4e 49 4c 2c 20 2f |universe|: NIL, /|
|00001bb0| 2f 20 75 6e 69 76 65 72 | 73 65 20 61 72 72 61 79 |/ univer|se array|
|00001bc0| 20 6f 66 20 61 72 72 61 | 79 73 20 28 63 72 65 61 | of arra|ys (crea|
|00001bd0| 74 65 64 20 62 79 20 6d | 61 6b 65 55 6e 69 76 65 |ted by m|akeUnive|
|00001be0| 72 73 65 29 0d 70 61 74 | 74 65 72 6e 3a 20 20 4e |rse).pat|tern: N|
|00001bf0| 49 4c 2c 20 2f 2f 20 64 | 65 66 61 75 6c 74 73 20 |IL, // d|efaults |
|00001c00| 74 6f 20 64 6f 74 2e 20 | 73 65 74 20 62 79 20 70 |to dot. |set by p|
|00001c10| 61 74 74 65 72 6e 50 69 | 63 6b 65 72 0d 6e 47 65 |atternPi|cker.nGe|
|00001c20| 6e 3a 20 20 20 20 20 20 | 20 30 2c 20 2f 2f 20 6e |n: | 0, // n|
|00001c30| 75 6d 62 65 72 20 6f 66 | 20 67 65 6e 65 72 61 74 |umber of| generat|
|00001c40| 69 6f 6e 73 20 28 63 6c | 65 61 72 20 3d 30 2c 20 |ions (cl|ear =0, |
|00001c50| 6e 65 78 74 47 65 6e 65 | 72 61 74 69 6f 6e 20 2b |nextGene|ration +|
|00001c60| 31 29 0d 0d 6b 44 72 61 | 77 54 6f 70 3a 20 20 32 |1)..kDra|wTop: 2|
|00001c70| 30 2c 20 2f 2f 20 65 78 | 74 72 61 20 73 70 61 63 |0, // ex|tra spac|
|00001c80| 65 20 61 62 6f 76 65 20 | 4c 69 66 65 44 72 61 77 |e above |LifeDraw|
|00001c90| 0d 6b 44 72 61 77 42 6f | 74 3a 20 20 33 35 2c 20 |.kDrawBo|t: 35, |
|00001ca0| 2f 2f 20 62 65 6c 6f 77 | 0d 6b 4d 61 78 41 70 70 |// below|.kMaxApp|
|00001cb0| 57 69 64 74 68 3a 20 32 | 34 30 2c 0d 0d 6d 61 6b |Width: 2|40,..mak|
|00001cc0| 65 55 6e 69 76 65 72 73 | 65 3a 20 66 75 6e 63 28 |eUnivers|e: func(|
|00001cd0| 29 0d 09 41 72 72 61 79 | 28 73 69 7a 65 59 20 2b |)..Array|(sizeY +|
|00001ce0| 20 32 2c 20 4e 49 4c 29 | 2c 20 2f 2f 20 6c 65 61 | 2, NIL)|, // lea|
|00001cf0| 76 65 20 72 6f 77 73 20 | 4e 49 4c 20 75 6e 74 69 |ve rows |NIL unti|
|00001d00| 6c 20 6e 65 65 64 65 64 | 0d 0d 76 69 65 77 53 65 |l needed|..viewSe|
|00001d10| 74 75 70 46 6f 72 6d 53 | 63 72 69 70 74 3a 20 66 |tupFormS|cript: f|
|00001d20| 75 6e 63 28 29 0d 09 62 | 65 67 69 6e 0d 09 73 65 |unc()..b|egin..se|
|00001d30| 6c 66 2e 4c 69 66 65 20 | 3a 3d 20 73 65 6c 66 3b |lf.Life |:= self;|
|00001d40| 20 2f 2f 20 66 6f 72 20 | 6c 61 74 65 72 20 73 74 | // for |later st|
|00001d50| 61 6e 64 61 6c 6f 6e 65 | 20 61 63 63 65 73 73 0d |andalone| access.|
|00001d60| 09 6c 6f 63 61 6c 20 68 | 74 2c 20 61 70 3a 3d 20 |.local h|t, ap:= |
|00001d70| 47 65 74 41 70 70 50 61 | 72 61 6d 73 28 29 3b 20 |GetAppPa|rams(); |
|00001d80| 2f 2f 20 63 6f 6e 66 69 | 67 75 72 65 20 74 6f 20 |// confi|gure to |
|00001d90| 63 75 72 72 65 6e 74 20 | 4d 50 20 73 63 72 65 65 |current |MP scree|
|00001da0| 6e 20 73 69 7a 65 0d 09 | 73 65 6c 66 2e 76 69 65 |n size..|self.vie|
|00001db0| 77 42 6f 75 6e 64 73 20 | 3a 3d 20 52 65 6c 42 6f |wBounds |:= RelBo|
|00001dc0| 75 6e 64 73 28 0d 09 09 | 61 70 2e 41 70 70 41 72 |unds(...|ap.AppAr|
|00001dd0| 65 61 4c 65 66 74 2c 61 | 70 2e 41 70 70 41 72 65 |eaLeft,a|p.AppAre|
|00001de0| 61 54 6f 70 2c 0d 09 09 | 4d 49 4e 28 61 70 2e 41 |aTop,...|MIN(ap.A|
|00001df0| 70 70 41 72 65 61 57 69 | 64 74 68 2c 20 6b 4d 61 |ppAreaWi|dth, kMa|
|00001e00| 78 41 70 70 57 69 64 74 | 68 29 2c 20 68 74 20 3a |xAppWidt|h), ht :|
|00001e10| 3d 20 4d 49 4e 28 61 70 | 2e 41 70 70 41 72 65 61 |= MIN(ap|.AppArea|
|00001e20| 48 65 69 67 68 74 2c 33 | 33 36 29 29 3b 0d 0d 09 |Height,3|36));...|
|00001e30| 63 65 6c 6c 53 69 7a 65 | 20 3a 3d 20 6b 4d 61 78 |cellSize| := kMax|
|00001e40| 41 70 70 57 69 64 74 68 | 20 44 49 56 20 28 73 69 |AppWidth| DIV (si|
|00001e50| 7a 65 58 2b 32 29 3b 0d | 09 73 69 7a 65 59 20 3a |zeX+2);.|.sizeY :|
|00001e60| 3d 20 28 28 68 74 20 2d | 20 6b 44 72 61 77 54 6f |= ((ht -| kDrawTo|
|00001e70| 70 20 2d 20 6b 44 72 61 | 77 42 6f 74 29 20 44 49 |p - kDra|wBot) DI|
|00001e80| 56 20 63 65 6c 6c 53 69 | 7a 65 29 20 2d 20 32 3b |V cellSi|ze) - 2;|
|00001e90| 0d 09 76 53 69 7a 65 58 | 20 3a 3d 20 63 65 6c 6c |..vSizeX| := cell|
|00001ea0| 53 69 7a 65 2a 28 73 69 | 7a 65 58 2b 32 29 3b 0d |Size*(si|zeX+2);.|
|00001eb0| 09 76 53 69 7a 65 59 20 | 3a 3d 20 63 65 6c 6c 53 |.vSizeY |:= cellS|
|00001ec0| 69 7a 65 2a 28 73 69 7a | 65 59 2b 32 29 3b 0d 09 |ize*(siz|eY+2);..|
|00001ed0| 75 6e 69 76 65 72 73 65 | 20 3a 3d 20 3a 6d 61 6b |universe| := :mak|
|00001ee0| 65 55 6e 69 76 65 72 73 | 65 28 29 3b 0d 09 66 69 |eUnivers|e();..fi|
|00001ef0| 72 73 74 52 6f 77 20 3a | 3d 20 6c 61 73 74 52 6f |rstRow :|= lastRo|
|00001f00| 77 20 3a 3d 20 66 69 72 | 73 74 43 6f 6c 20 3a 3d |w := fir|stCol :=|
|00001f10| 20 6c 61 73 74 43 6f 6c | 20 3a 3d 20 4e 49 4c 3b | lastCol| := NIL;|
|00001f20| 0d 09 65 6e 64 2c 0d 7d | 0d 2d 2d 2d 2d 2d 2d 2d |..end,.}|.-------|
|00001f30| 2d 2d 2d 0d 4c 69 66 65 | 2e 69 64 6c 65 53 74 75 |---.Life|.idleStu|
|00001f40| 66 66 7e 0d 7b 2f 2f 73 | 6f 6d 65 20 61 64 64 69 |ff~.{//s|ome addi|
|00001f50| 74 69 6f 6e 61 6c 20 4c | 69 66 65 20 6d 65 74 68 |tional L|ife meth|
|00001f60| 6f 64 73 2f 73 6c 6f 74 | 73 20 72 65 6c 61 74 65 |ods/slot|s relate|
|00001f70| 64 20 74 6f 20 69 64 6c | 69 6e 67 20 28 22 52 65 |d to idl|ing ("Re|
|00001f80| 70 65 61 74 22 29 0d 76 | 69 65 77 49 64 6c 65 53 |peat").v|iewIdleS|
|00001f90| 63 72 69 70 74 3a 20 66 | 75 6e 63 28 29 0d 09 69 |cript: f|unc()..i|
|00001fa0| 66 20 6e 6f 74 20 73 74 | 6f 70 70 65 64 0d 09 74 |f not st|opped..t|
|00001fb0| 68 65 6e 20 62 65 67 69 | 6e 0d 09 09 3a 6e 65 78 |hen begi|n...:nex|
|00001fc0| 74 47 65 6e 65 72 61 74 | 69 6f 6e 28 29 3b 20 2f |tGenerat|ion(); /|
|00001fd0| 2f 20 67 65 6e 65 72 61 | 74 65 0d 09 09 69 66 20 |/ genera|te...if |
|00001fe0| 66 69 72 73 74 52 6f 77 | 0d 09 09 74 68 65 6e 20 |firstRow|...then |
|00001ff0| 64 65 6c 61 79 4d 53 65 | 63 73 20 2f 2f 20 72 65 |delayMSe|cs // re|
|00002000| 73 63 68 65 64 75 6c 65 | 0d 09 09 65 6c 73 65 20 |schedule|...else |
|00002010| 62 65 67 69 6e 20 2f 2f | 20 65 6d 70 74 79 20 75 |begin //| empty u|
|00002020| 6e 69 76 65 72 73 65 0d | 09 09 09 53 65 74 56 61 |niverse.|...SetVa|
|00002030| 6c 75 65 28 73 74 61 74 | 75 73 2e 72 65 70 65 61 |lue(stat|us.repea|
|00002040| 74 42 75 74 74 6f 6e 2c | 20 27 74 65 78 74 2c 20 |tButton,| 'text, |
|00002050| 22 52 65 70 65 61 74 22 | 29 3b 0d 09 09 09 73 74 |"Repeat"|);....st|
|00002060| 6f 70 70 65 64 20 3a 3d | 20 54 52 55 45 3b 20 0d |opped :=| TRUE; .|
|00002070| 09 09 09 4e 49 4c 20 2f | 2f 20 74 75 72 6e 20 6f |...NIL /|/ turn o|
|00002080| 66 66 20 69 64 6c 69 6e | 67 20 62 79 20 72 65 74 |ff idlin|g by ret|
|00002090| 75 72 6e 69 6e 67 20 6e | 69 6c 0d 09 09 09 65 6e |urning n|il....en|
|000020a0| 64 3b 0d 09 09 65 6e 64 | 2c 0d 0d 64 65 6c 61 79 |d;...end|,..delay|
|000020b0| 4d 73 65 63 73 3a 20 34 | 30 2c 20 2f 2f 20 61 6c |Msecs: 4|0, // al|
|000020c0| 6c 6f 77 20 65 6e 6f 75 | 67 68 20 6d 69 6c 6c 69 |low enou|gh milli|
|000020d0| 73 65 63 6f 6e 64 73 20 | 69 6e 20 62 65 74 77 65 |seconds |in betwe|
|000020e0| 65 6e 20 66 6f 72 20 74 | 61 70 73 0d 73 74 6f 70 |en for t|aps.stop|
|000020f0| 70 65 64 3a 20 54 52 55 | 45 2c 0d 7d 0d 2d 2d 2d |ped: TRU|E,.}.---|
|00002100| 2d 2d 2d 2d 2d 2d 2d 0d | 4c 69 66 65 2e 6c 69 66 |-------.|Life.lif|
|00002110| 65 53 74 75 66 66 7e 0d | 7b 2f 2f 20 73 6f 6d 65 |eStuff~.|{// some|
|00002120| 20 61 64 64 69 74 69 6f | 6e 61 6c 20 4c 69 66 65 | additio|nal Life|
|00002130| 20 6d 65 74 68 6f 64 73 | 2c 20 73 70 65 63 69 66 | methods|, specif|
|00002140| 69 63 20 74 6f 20 4c 69 | 66 65 0d 6d 61 6b 65 52 |ic to Li|fe.makeR|
|00002150| 6f 77 3a 20 66 75 6e 63 | 28 29 0d 09 41 72 72 61 |ow: func|()..Arra|
|00002160| 79 28 73 69 7a 65 58 20 | 2b 20 32 2c 20 30 29 2c |y(sizeX |+ 2, 0),|
|00002170| 20 20 20 2f 2f 20 69 6e | 69 74 69 61 6c 20 76 61 | // in|itial va|
|00002180| 6c 75 65 73 20 30 20 28 | 72 61 74 68 65 72 20 74 |lues 0 (|rather t|
|00002190| 68 61 6e 20 4e 49 4c 29 | 0d 0d 63 6c 65 61 72 3a |han NIL)|..clear:|
|000021a0| 20 66 75 6e 63 28 29 0d | 09 62 65 67 69 6e 0d 09 | func().|.begin..|
|000021b0| 75 6e 69 76 65 72 73 65 | 20 3a 3d 20 3a 6d 61 6b |universe| := :mak|
|000021c0| 65 55 6e 69 76 65 72 73 | 65 28 29 3b 0d 09 66 69 |eUnivers|e();..fi|
|000021d0| 72 73 74 52 6f 77 20 3a | 3d 20 6c 61 73 74 52 6f |rstRow :|= lastRo|
|000021e0| 77 20 3a 3d 20 66 69 72 | 73 74 43 6f 6c 20 3a 3d |w := fir|stCol :=|
|000021f0| 20 6c 61 73 74 43 6f 6c | 20 3a 3d 20 4e 49 4c 3b | lastCol| := NIL;|
|00002200| 20 2f 2f 20 61 6c 6c 20 | 65 6d 70 74 79 0d 09 4c | // all |empty..L|
|00002210| 69 66 65 44 72 61 77 3a | 44 69 72 74 79 28 29 3b |ifeDraw:|Dirty();|
|00002220| 20 2f 2f 20 72 65 64 72 | 61 77 20 6e 65 78 74 20 | // redr|aw next |
|00002230| 69 64 6c 65 20 76 69 61 | 20 76 69 65 77 44 72 61 |idle via| viewDra|
|00002240| 77 53 63 72 69 70 74 0d | 09 6e 47 65 6e 20 3a 3d |wScript.|.nGen :=|
|00002250| 20 30 3b 0d 09 53 65 74 | 56 61 6c 75 65 28 6e 75 | 0;..Set|Value(nu|
|00002260| 6d 47 65 6e 2c 27 74 65 | 78 74 2c 22 47 65 6e 3a |mGen,'te|xt,"Gen:|
|00002270| 20 30 22 29 3b 0d 09 65 | 6e 64 2c 0d 0d 63 6f 75 | 0");..e|nd,..cou|
|00002280| 6e 74 4e 65 69 67 68 62 | 6f 72 73 3a 20 66 75 6e |ntNeighb|ors: fun|
|00002290| 63 28 78 2c 79 2c 6f 63 | 63 29 0d 09 62 65 67 69 |c(x,y,oc|c)..begi|
|000022a0| 6e 20 2f 2f 20 63 6f 75 | 6e 74 20 6e 75 6d 62 65 |n // cou|nt numbe|
|000022b0| 72 20 6f 66 20 6e 65 61 | 72 62 79 20 28 38 29 20 |r of nea|rby (8) |
|000022c0| 63 65 6c 6c 73 20 74 68 | 61 74 20 61 72 65 20 66 |cells th|at are f|
|000022d0| 69 6c 6c 65 64 0d 09 6c | 6f 63 61 6c 20 79 79 2c |illed..l|ocal yy,|
|000022e0| 20 72 6f 77 2c 20 63 6e | 74 20 3a 3d 20 2d 6f 63 | row, cn|t := -oc|
|000022f0| 63 3b 20 2f 2f 20 64 6f | 6e 27 74 20 63 6f 75 6e |c; // do|n't coun|
|00002300| 74 20 63 65 6e 74 65 72 | 20 63 65 6c 6c 0d 09 66 |t center| cell..f|
|00002310| 6f 72 20 79 79 20 3a 3d | 20 79 2d 31 20 74 6f 20 |or yy :=| y-1 to |
|00002320| 79 2b 31 0d 09 64 6f 20 | 69 66 20 72 6f 77 20 3a |y+1..do |if row :|
|00002330| 3d 20 75 6e 69 76 65 72 | 73 65 5b 79 79 5d 0d 09 |= univer|se[yy]..|
|00002340| 09 74 68 65 6e 20 63 6e | 74 20 3a 3d 20 63 6e 74 |.then cn|t := cnt|
|00002350| 20 2b 20 72 6f 77 5b 78 | 2d 31 5d 2b 72 6f 77 5b | + row[x|-1]+row[|
|00002360| 78 5d 2b 72 6f 77 5b 78 | 2b 31 5d 3b 0d 09 09 2f |x]+row[x|+1];.../|
|00002370| 2f 66 6f 72 20 78 78 20 | 3a 3d 20 78 2d 31 20 74 |/for xx |:= x-1 t|
|00002380| 6f 20 78 2b 31 20 64 6f | 20 69 66 20 72 6f 77 5b |o x+1 do| if row[|
|00002390| 78 78 5d 20 74 68 65 6e | 20 63 6e 74 20 3a 3d 20 |xx] then| cnt := |
|000023a0| 63 6e 74 2b 31 3b 0d 09 | 63 6e 74 3b 0d 09 65 6e |cnt+1;..|cnt;..en|
|000023b0| 64 2c 0d 7d 0d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |d,.}.---|-------.|
|000023c0| 4c 69 66 65 2e 6e 65 78 | 74 47 65 6e 65 72 61 74 |Life.nex|tGenerat|
|000023d0| 69 6f 6e 0d 66 75 6e 63 | 28 29 20 2f 2f 20 61 20 |ion.func|() // a |
|000023e0| 73 65 70 61 72 61 74 65 | 20 65 6e 74 72 79 20 66 |separate| entry f|
|000023f0| 6f 72 20 65 64 69 74 69 | 6e 67 0d 69 66 20 66 69 |or editi|ng.if fi|
|00002400| 72 73 74 52 6f 77 20 2f | 2f 20 69 66 20 6e 6f 20 |rstRow /|/ if no |
|00002410| 63 65 6c 6c 73 20 6f 63 | 63 75 70 69 65 64 2c 20 |cells oc|cupied, |
|00002420| 6e 6f 74 68 69 6e 67 20 | 74 6f 20 67 65 6e 65 72 |nothing |to gener|
|00002430| 61 74 65 0d 74 68 65 6e | 20 62 65 67 69 6e 0d 09 |ate.then| begin..|
|00002440| 6c 6f 63 61 6c 20 6e 65 | 77 55 6e 69 76 65 72 73 |local ne|wUnivers|
|00002450| 65 20 3a 3d 20 3a 6d 61 | 6b 65 55 6e 69 76 65 72 |e := :ma|keUniver|
|00002460| 73 65 28 29 3b 20 2f 2f | 20 6e 65 77 20 65 6d 70 |se(); //| new emp|
|00002470| 74 79 20 75 6e 69 76 65 | 72 73 65 0d 09 6c 6f 63 |ty unive|rse..loc|
|00002480| 61 6c 20 78 2c 20 79 2c | 20 72 6f 77 2c 20 6f 63 |al x, y,| row, oc|
|00002490| 63 75 70 69 65 64 2c 20 | 6e 65 77 52 6f 77 2c 20 |cupied, |newRow, |
|000024a0| 6e 65 69 67 68 62 6f 72 | 73 2c 20 6e 65 77 46 69 |neighbor|s, newFi|
|000024b0| 72 73 74 52 6f 77 2c 20 | 6e 65 77 4c 61 73 74 52 |rstRow, |newLastR|
|000024c0| 6f 77 3b 0d 09 6c 6f 63 | 61 6c 20 6e 65 77 4c 61 |ow;..loc|al newLa|
|000024d0| 73 74 43 6f 6c 20 20 3a | 3d 20 66 63 6f 6c 20 3a |stCol :|= fcol :|
|000024e0| 3d 20 6d 61 78 28 66 69 | 72 73 74 43 6f 6c 2d 31 |= max(fi|rstCol-1|
|000024f0| 2c 31 29 3b 0d 09 6c 6f | 63 61 6c 20 6e 65 77 46 |,1);..lo|cal newF|
|00002500| 69 72 73 74 43 6f 6c 20 | 3a 3d 20 6c 63 6f 6c 20 |irstCol |:= lcol |
|00002510| 3a 3d 20 6d 69 6e 28 6c | 61 73 74 43 6f 6c 2b 31 |:= min(l|astCol+1|
|00002520| 2c 73 69 7a 65 58 29 2c | 20 66 72 78 2c 20 6c 72 |,sizeX),| frx, lr|
|00002530| 78 3b 0d 09 66 6f 72 20 | 79 20 3a 3d 20 6d 61 78 |x;..for |y := max|
|00002540| 28 66 69 72 73 74 52 6f | 77 2d 31 2c 31 29 20 74 |(firstRo|w-1,1) t|
|00002550| 6f 20 6d 69 6e 28 6c 61 | 73 74 52 6f 77 2b 31 2c |o min(la|stRow+1,|
|00002560| 73 69 7a 65 59 29 20 2f | 2f 20 73 6b 69 70 20 73 |sizeY) /|/ skip s|
|00002570| 6f 6d 65 20 64 65 61 64 | 20 72 6f 77 73 20 62 65 |ome dead| rows be|
|00002580| 66 6f 72 65 2f 61 66 74 | 65 72 20 61 63 74 69 76 |fore/aft|er activ|
|00002590| 65 20 61 72 65 61 0d 09 | 64 6f 20 62 65 67 69 6e |e area..|do begin|
|000025a0| 0d 09 09 6e 65 77 52 6f | 77 20 3a 3d 20 66 72 78 |...newRo|w := frx|
|000025b0| 20 3a 3d 20 6c 72 78 20 | 3a 3d 20 4e 49 4c 3b 0d | := lrx |:= NIL;.|
|000025c0| 09 09 72 6f 77 20 3a 3d | 20 75 6e 69 76 65 72 73 |..row :=| univers|
|000025d0| 65 5b 79 5d 3b 0d 09 09 | 66 6f 72 20 78 20 3a 3d |e[y];...|for x :=|
|000025e0| 20 66 63 6f 6c 20 74 6f | 20 6c 63 6f 6c 20 2f 2f | fcol to| lcol //|
|000025f0| 20 73 6b 69 70 20 73 6f | 6d 65 20 64 65 61 64 20 | skip so|me dead |
|00002600| 63 6f 6c 75 6d 6e 73 20 | 62 65 66 6f 72 65 2f 61 |columns |before/a|
|00002610| 66 74 65 72 20 61 63 74 | 69 76 65 20 61 72 65 61 |fter act|ive area|
|00002620| 0d 09 09 64 6f 20 62 65 | 67 69 6e 0d 09 09 09 6f |...do be|gin....o|
|00002630| 63 63 75 70 69 65 64 20 | 3a 3d 20 69 66 20 72 6f |ccupied |:= if ro|
|00002640| 77 20 74 68 65 6e 20 72 | 6f 77 5b 78 5d 20 65 6c |w then r|ow[x] el|
|00002650| 73 65 20 30 3b 0d 09 09 | 09 6e 65 69 67 68 62 6f |se 0;...|.neighbo|
|00002660| 72 73 20 3a 3d 20 3a 63 | 6f 75 6e 74 4e 65 69 67 |rs := :c|ountNeig|
|00002670| 68 62 6f 72 73 28 78 2c | 79 2c 6f 63 63 75 70 69 |hbors(x,|y,occupi|
|00002680| 65 64 29 3b 0d 09 09 09 | 69 66 20 6e 65 69 67 68 |ed);....|if neigh|
|00002690| 62 6f 72 73 3d 33 20 6f | 72 20 28 6f 63 63 75 70 |bors=3 o|r (occup|
|000026a0| 69 65 64 3e 30 20 61 6e | 64 20 6e 65 69 67 68 62 |ied>0 an|d neighb|
|000026b0| 6f 72 73 3d 32 29 0d 09 | 09 09 74 68 65 6e 20 62 |ors=2)..|..then b|
|000026c0| 65 67 69 6e 0d 09 09 09 | 09 69 66 20 6e 6f 74 20 |egin....|.if not |
|000026d0| 6e 65 77 52 6f 77 20 2f | 2f 20 63 72 65 61 74 65 |newRow /|/ create|
|000026e0| 20 61 20 6e 65 77 20 72 | 6f 77 3f 0d 09 09 09 09 | a new r|ow?.....|
|000026f0| 74 68 65 6e 20 6e 65 77 | 52 6f 77 20 3a 3d 20 3a |then new|Row := :|
|00002700| 6d 61 6b 65 52 6f 77 28 | 29 3b 0d 09 09 09 09 6e |makeRow(|);.....n|
|00002710| 65 77 52 6f 77 5b 78 5d | 20 3a 3d 20 31 3b 0d 09 |ewRow[x]| := 1;..|
|00002720| 09 09 09 6e 65 77 4c 61 | 73 74 52 6f 77 20 3a 3d |...newLa|stRow :=|
|00002730| 20 79 3b 0d 09 09 09 09 | 69 66 20 6e 6f 74 20 66 | y;.....|if not f|
|00002740| 72 78 20 74 68 65 6e 20 | 66 72 78 20 3a 3d 20 78 |rx then |frx := x|
|00002750| 3b 0d 09 09 09 09 6c 72 | 78 20 3a 3d 20 78 3b 0d |;.....lr|x := x;.|
|00002760| 09 09 09 09 65 6e 64 3b | 0d 09 09 09 65 6e 64 3b |....end;|....end;|
|00002770| 0d 09 09 69 66 20 6e 6f | 74 20 6e 65 77 46 69 72 |...if no|t newFir|
|00002780| 73 74 52 6f 77 20 74 68 | 65 6e 20 6e 65 77 46 69 |stRow th|en newFi|
|00002790| 72 73 74 52 6f 77 20 3a | 3d 20 6e 65 77 4c 61 73 |rstRow :|= newLas|
|000027a0| 74 52 6f 77 3b 0d 09 09 | 6e 65 77 55 6e 69 76 65 |tRow;...|newUnive|
|000027b0| 72 73 65 5b 79 5d 20 3a | 3d 20 6e 65 77 52 6f 77 |rse[y] :|= newRow|
|000027c0| 3b 0d 09 09 69 66 20 66 | 72 78 20 74 68 65 6e 20 |;...if f|rx then |
|000027d0| 6e 65 77 46 69 72 73 74 | 43 6f 6c 20 3a 3d 20 6d |newFirst|Col := m|
|000027e0| 69 6e 28 6e 65 77 46 69 | 72 73 74 43 6f 6c 2c 66 |in(newFi|rstCol,f|
|000027f0| 72 78 29 3b 0d 09 09 69 | 66 20 6c 72 78 20 74 68 |rx);...i|f lrx th|
|00002800| 65 6e 20 6e 65 77 4c 61 | 73 74 43 6f 6c 20 20 3a |en newLa|stCol :|
|00002810| 3d 20 6d 61 78 28 6e 65 | 77 4c 61 73 74 43 6f 6c |= max(ne|wLastCol|
|00002820| 2c 20 6c 72 78 29 3b 0d | 09 09 65 6e 64 3b 0d 09 |, lrx);.|..end;..|
|00002830| 75 6e 69 76 65 72 73 65 | 20 3a 3d 20 6e 65 77 55 |universe| := newU|
|00002840| 6e 69 76 65 72 73 65 3b | 0d 09 66 69 72 73 74 52 |niverse;|..firstR|
|00002850| 6f 77 20 3a 3d 20 6e 65 | 77 46 69 72 73 74 52 6f |ow := ne|wFirstRo|
|00002860| 77 3b 0d 09 6c 61 73 74 | 52 6f 77 20 20 3a 3d 20 |w;..last|Row := |
|00002870| 6e 65 77 4c 61 73 74 52 | 6f 77 3b 0d 09 66 69 72 |newLastR|ow;..fir|
|00002880| 73 74 43 6f 6c 20 3a 3d | 20 6e 65 77 46 69 72 73 |stCol :=| newFirs|
|00002890| 74 43 6f 6c 3b 0d 09 6c | 61 73 74 43 6f 6c 20 20 |tCol;..l|astCol |
|000028a0| 3a 3d 20 6e 65 77 4c 61 | 73 74 43 6f 6c 3b 0d 09 |:= newLa|stCol;..|
|000028b0| 4c 69 66 65 44 72 61 77 | 3a 44 69 72 74 79 28 29 |LifeDraw|:Dirty()|
|000028c0| 3b 0d 09 53 65 74 56 61 | 6c 75 65 28 6e 75 6d 47 |;..SetVa|lue(numG|
|000028d0| 65 6e 2c 20 27 74 65 78 | 74 2c 20 22 47 65 6e 3a |en, 'tex|t, "Gen:|
|000028e0| 22 20 26 26 20 28 6e 47 | 65 6e 20 3a 3d 20 6e 47 |" && (nG|en := nG|
|000028f0| 65 6e 2b 31 29 29 3b 0d | 09 65 6e 64 0d 2d 2d 2d |en+1));.|.end.---|
|00002900| 2d 2d 2d 2d 2d 2d 2d 0d | 4c 69 66 65 2b 4c 69 66 |-------.|Life+Lif|
|00002910| 65 44 72 61 77 0d 7b 2f | 2f 20 61 20 64 72 61 77 |eDraw.{/|/ a draw|
|00002920| 69 6e 67 20 61 72 65 61 | 20 28 73 74 65 70 63 68 |ing area| (stepch|
|00002930| 69 6c 64 20 6f 66 20 4c | 69 66 65 29 0d 76 69 65 |ild of L|ife).vie|
|00002940| 77 43 6c 61 73 73 3a 20 | 27 63 6c 56 69 65 77 2c |wClass: |'clView,|
|00002950| 0d 76 69 65 77 46 6c 61 | 67 73 3a 20 20 35 31 33 |.viewFla|gs: 513|
|00002960| 2c 20 2f 2f 20 76 56 69 | 73 69 62 6c 65 20 2b 20 |, // vVi|sible + |
|00002970| 76 43 6c 69 63 6b 61 62 | 6c 65 0d 76 69 65 77 4a |vClickab|le.viewJ|
|00002980| 75 73 74 69 66 79 3a 20 | 31 36 2c 20 2f 2f 20 76 |ustify: |16, // v|
|00002990| 6a 50 61 72 65 6e 74 43 | 65 6e 74 65 72 48 20 2b |jParentC|enterH +|
|000029a0| 20 76 6a 50 61 72 65 6e | 74 54 6f 70 56 0d 76 69 | vjParen|tTopV.vi|
|000029b0| 65 77 46 6f 72 6d 61 74 | 3a 20 33 33 37 2c 20 2f |ewFormat|: 337, /|
|000029c0| 2f 20 76 66 46 69 6c 6c | 57 68 69 74 65 20 2b 20 |/ vfFill|White + |
|000029d0| 76 66 46 72 61 6d 65 42 | 6c 61 63 6b 20 2b 20 76 |vfFrameB|lack + v|
|000029e0| 66 50 65 6e 2a 31 2c 0d | 0d 76 69 65 77 53 65 74 |fPen*1,.|.viewSet|
|000029f0| 75 70 46 6f 72 6d 53 63 | 72 69 70 74 3a 20 66 75 |upFormSc|ript: fu|
|00002a00| 6e 63 28 29 0d 09 73 65 | 6c 66 2e 76 69 65 77 42 |nc()..se|lf.viewB|
|00002a10| 6f 75 6e 64 73 20 3a 3d | 20 52 65 6c 42 6f 75 6e |ounds :=| RelBoun|
|00002a20| 64 73 28 30 2c 6b 44 72 | 61 77 54 6f 70 2c 76 53 |ds(0,kDr|awTop,vS|
|00002a30| 69 7a 65 58 2c 76 53 69 | 7a 65 59 29 2c 0d 0d 76 |izeX,vSi|zeY),..v|
|00002a40| 69 65 77 44 72 61 77 53 | 63 72 69 70 74 3a 20 66 |iewDrawS|cript: f|
|00002a50| 75 6e 63 28 29 0d 09 62 | 65 67 69 6e 0d 09 6c 6f |unc()..b|egin..lo|
|00002a60| 63 61 6c 20 78 2c 20 79 | 2c 20 72 6f 77 2c 20 64 |cal x, y|, row, d|
|00002a70| 72 61 77 4d 6f 64 65 2c | 20 79 31 2c 20 79 32 3b |rawMode,| y1, y2;|
|00002a80| 0d 09 69 66 20 73 74 6f | 70 70 65 64 0d 09 74 68 |..if sto|pped..th|
|00002a90| 65 6e 20 62 65 67 69 6e | 20 2f 2f 20 61 64 64 20 |en begin| // add |
|00002aa0| 67 72 69 64 20 6c 69 6e | 65 73 0d 09 09 64 72 61 |grid lin|es...dra|
|00002ab0| 77 4d 6f 64 65 20 3a 3d | 20 27 7b 20 2f 2f 20 66 |wMode :=| '{ // f|
|00002ac0| 6f 72 20 6c 69 6e 65 73 | 0d 09 09 09 70 65 6e 53 |or lines|....penS|
|00002ad0| 69 7a 65 3a 20 31 2c 0d | 09 09 09 70 65 6e 50 61 |ize: 1,.|...penPa|
|00002ae0| 74 74 65 72 6e 3a 20 33 | 2c 20 2f 2f 20 76 66 47 |ttern: 3|, // vfG|
|00002af0| 72 61 79 0d 09 09 09 7d | 3b 0d 09 09 66 6f 72 20 |ray....}|;...for |
|00002b00| 79 20 3a 3d 20 63 65 6c | 6c 53 69 7a 65 20 74 6f |y := cel|lSize to|
|00002b10| 20 76 53 69 7a 65 59 2d | 63 65 6c 6c 53 69 7a 65 | vSizeY-|cellSize|
|00002b20| 20 62 79 20 63 65 6c 6c | 53 69 7a 65 0d 09 09 64 | by cell|Size...d|
|00002b30| 6f 20 3a 44 72 61 77 53 | 68 61 70 65 28 4d 61 6b |o :DrawS|hape(Mak|
|00002b40| 65 4c 69 6e 65 28 30 2c | 79 2c 76 53 69 7a 65 58 |eLine(0,|y,vSizeX|
|00002b50| 2c 79 29 2c 20 64 72 61 | 77 4d 6f 64 65 29 3b 0d |,y), dra|wMode);.|
|00002b60| 09 09 66 6f 72 20 78 20 | 3a 3d 20 63 65 6c 6c 53 |..for x |:= cellS|
|00002b70| 69 7a 65 20 74 6f 20 76 | 53 69 7a 65 58 2d 63 65 |ize to v|SizeX-ce|
|00002b80| 6c 6c 53 69 7a 65 20 62 | 79 20 63 65 6c 6c 53 69 |llSize b|y cellSi|
|00002b90| 7a 65 0d 09 09 64 6f 20 | 3a 44 72 61 77 53 68 61 |ze...do |:DrawSha|
|00002ba0| 70 65 28 4d 61 6b 65 4c | 69 6e 65 28 78 2c 30 2c |pe(MakeL|ine(x,0,|
|00002bb0| 78 2c 76 53 69 7a 65 59 | 29 2c 20 20 64 72 61 77 |x,vSizeY|), draw|
|00002bc0| 4d 6f 64 65 29 3b 0d 09 | 09 65 6e 64 3b 0d 09 64 |Mode);..|.end;..d|
|00002bd0| 72 61 77 4d 6f 64 65 20 | 3a 3d 20 27 7b 20 2f 2f |rawMode |:= '{ //|
|00002be0| 20 66 6f 72 20 6f 76 61 | 6c 73 0d 09 09 74 72 61 | for ova|ls...tra|
|00002bf0| 6e 73 66 65 72 4d 6f 64 | 65 3a 20 30 2c 20 2f 2f |nsferMod|e: 0, //|
|00002c00| 20 6d 6f 64 65 43 6f 70 | 79 0d 09 09 66 69 6c 6c | modeCop|y...fill|
|00002c10| 50 61 74 74 65 72 6e 3a | 20 20 35 2c 20 2f 2f 20 |Pattern:| 5, // |
|00002c20| 76 66 46 69 6c 6c 42 6c | 61 63 6b 0d 09 09 7d 3b |vfFillBl|ack...};|
|00002c30| 0d 09 69 66 20 66 69 72 | 73 74 52 6f 77 0d 09 74 |..if fir|stRow..t|
|00002c40| 68 65 6e 20 66 6f 72 20 | 79 20 3a 3d 20 66 69 72 |hen for |y := fir|
|00002c50| 73 74 52 6f 77 20 74 6f | 20 6c 61 73 74 52 6f 77 |stRow to| lastRow|
|00002c60| 0d 09 09 64 6f 20 69 66 | 20 72 6f 77 20 3a 3d 20 |...do if| row := |
|00002c70| 75 6e 69 76 65 72 73 65 | 5b 79 5d 0d 09 09 09 74 |universe|[y]....t|
|00002c80| 68 65 6e 20 62 65 67 69 | 6e 0d 09 09 09 09 79 31 |hen begi|n.....y1|
|00002c90| 20 3a 3d 20 79 2a 63 65 | 6c 6c 53 69 7a 65 3b 20 | := y*ce|llSize; |
|00002ca0| 79 32 20 3a 3d 20 79 31 | 2b 63 65 6c 6c 53 69 7a |y2 := y1|+cellSiz|
|00002cb0| 65 3b 20 2f 2f 20 63 6f | 6e 73 74 61 6e 74 20 66 |e; // co|nstant f|
|00002cc0| 6f 72 20 72 6f 77 0d 09 | 09 09 09 66 6f 72 20 78 |or row..|...for x|
|00002cd0| 20 3a 3d 20 66 69 72 73 | 74 43 6f 6c 20 74 6f 20 | := firs|tCol to |
|00002ce0| 6c 61 73 74 43 6f 6c 0d | 09 09 09 09 64 6f 20 69 |lastCol.|....do i|
|00002cf0| 66 20 72 6f 77 5b 78 5d | 3e 30 0d 09 09 09 09 74 |f row[x]|>0.....t|
|00002d00| 68 65 6e 20 3a 44 72 61 | 77 53 68 61 70 65 28 0d |hen :Dra|wShape(.|
|00002d10| 09 09 09 09 09 09 4d 61 | 6b 65 4f 76 61 6c 28 78 |......Ma|keOval(x|
|00002d20| 2a 63 65 6c 6c 53 69 7a | 65 2c 79 31 2c 28 78 2b |*cellSiz|e,y1,(x+|
|00002d30| 31 29 2a 63 65 6c 6c 53 | 69 7a 65 2c 79 32 29 2c |1)*cellS|ize,y2),|
|00002d40| 0d 09 09 09 09 09 09 64 | 72 61 77 4d 6f 64 65 29 |.......d|rawMode)|
|00002d50| 3b 0d 09 09 09 09 65 6e | 64 3b 0d 09 65 6e 64 2c |;.....en|d;..end,|
|00002d60| 0d 7d 0d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 0d 4c 69 |.}.-----|-----.Li|
|00002d70| 66 65 2e 4c 69 66 65 44 | 72 61 77 2e 76 69 65 77 |fe.LifeD|raw.view|
|00002d80| 43 6c 69 63 6b 53 63 72 | 69 70 74 0d 66 75 6e 63 |ClickScr|ipt.func|
|00002d90| 28 75 6e 69 74 29 20 2f | 2f 20 61 20 73 65 70 61 |(unit) /|/ a sepa|
|00002da0| 72 61 74 65 20 65 6e 74 | 72 79 20 66 6f 72 20 65 |rate ent|ry for e|
|00002db0| 64 69 74 69 6e 67 0d 09 | 62 65 67 69 6e 0d 09 6c |diting..|begin..l|
|00002dc0| 6f 63 61 6c 20 67 62 20 | 3a 3d 20 3a 47 6c 6f 62 |ocal gb |:= :Glob|
|00002dd0| 61 6c 42 6f 78 28 29 2c | 20 72 6f 77 2c 20 79 3b |alBox(),| row, y;|
|00002de0| 0d 09 6c 6f 63 61 6c 20 | 79 6c 65 6e 20 3a 3d 20 |..local |ylen := |
|00002df0| 69 66 20 70 61 74 74 65 | 72 6e 20 74 68 65 6e 20 |if patte|rn then |
|00002e00| 6c 65 6e 67 74 68 28 70 | 61 74 74 65 72 6e 29 20 |length(p|attern) |
|00002e10| 65 6c 73 65 20 30 2c 20 | 78 6c 65 6e 2c 20 72 6c |else 0, |xlen, rl|
|00002e20| 65 6e 3b 0d 09 2f 2f 20 | 63 6f 6e 76 65 72 74 20 |en;..// |convert |
|00002e30| 74 6f 20 6c 6f 63 61 6c | 2c 20 67 72 69 64 20 63 |to local|, grid c|
|00002e40| 6f 6f 72 64 69 6e 61 74 | 65 73 0d 09 6c 6f 63 61 |oordinat|es..loca|
|00002e50| 6c 20 63 6c 69 63 6b 58 | 20 3a 3d 20 78 32 20 3a |l clickX| := x2 :|
|00002e60| 3d 20 28 47 65 74 50 6f | 69 6e 74 28 30 2c 20 75 |= (GetPo|int(0, u|
|00002e70| 6e 69 74 29 20 2d 20 67 | 62 2e 6c 65 66 74 29 20 |nit) - g|b.left) |
|00002e80| 64 69 76 20 63 65 6c 6c | 53 69 7a 65 3b 20 2f 2f |div cell|Size; //|
|00002e90| 20 30 3d 66 69 72 73 74 | 58 0d 09 6c 6f 63 61 6c | 0=first|X..local|
|00002ea0| 20 63 6c 69 63 6b 59 20 | 3a 3d 20 79 32 20 3a 3d | clickY |:= y2 :=|
|00002eb0| 20 28 47 65 74 50 6f 69 | 6e 74 28 31 2c 20 75 6e | (GetPoi|nt(1, un|
|00002ec0| 69 74 29 20 2d 20 67 62 | 2e 74 6f 70 29 20 20 64 |it) - gb|.top) d|
|00002ed0| 69 76 20 63 65 6c 6c 53 | 69 7a 65 3b 20 2f 2f 20 |iv cellS|ize; // |
|00002ee0| 31 3d 66 69 72 73 74 59 | 0d 0d 09 69 66 20 63 6c |1=firstY|...if cl|
|00002ef0| 69 63 6b 58 20 3e 3d 31 | 20 61 6e 64 20 63 6c 69 |ickX >=1| and cli|
|00002f00| 63 6b 58 20 3c 3d 20 73 | 69 7a 65 58 20 61 6e 64 |ckX <= s|izeX and|
|00002f10| 0d 09 20 20 20 63 6c 69 | 63 6b 59 20 3e 3d 31 20 |.. cli|ckY >=1 |
|00002f20| 61 6e 64 20 63 6c 69 63 | 6b 59 20 3c 3d 20 73 69 |and clic|kY <= si|
|00002f30| 7a 65 59 0d 09 74 68 65 | 6e 20 62 65 67 69 6e 0d |zeY..the|n begin.|
|00002f40| 09 09 69 66 20 79 6c 65 | 6e 3e 30 0d 09 09 74 68 |..if yle|n>0...th|
|00002f50| 65 6e 20 62 65 67 69 6e | 20 2f 2f 20 63 6f 70 79 |en begin| // copy|
|00002f60| 20 70 61 74 74 65 72 6e | 73 0d 09 09 09 69 66 20 | pattern|s....if |
|00002f70| 79 32 2b 79 6c 65 6e 20 | 3e 20 73 69 7a 65 59 0d |y2+ylen |> sizeY.|
|00002f80| 09 09 09 74 68 65 6e 20 | 79 6c 65 6e 20 3a 3d 20 |...then |ylen := |
|00002f90| 73 69 7a 65 59 20 2d 20 | 79 32 20 2b 20 31 3b 20 |sizeY - |y2 + 1; |
|00002fa0| 2f 2f 20 63 6c 69 70 20 | 70 61 74 74 65 72 6e 20 |// clip |pattern |
|00002fb0| 61 74 20 62 6f 74 74 6f | 6d 0d 09 09 09 79 32 20 |at botto|m....y2 |
|00002fc0| 3a 3d 20 79 32 20 2b 20 | 79 6c 65 6e 20 2d 20 31 |:= y2 + |ylen - 1|
|00002fd0| 3b 0d 09 09 09 78 6c 65 | 6e 20 3a 3d 20 6c 65 6e |;....xle|n := len|
|00002fe0| 67 74 68 28 70 61 74 74 | 65 72 6e 5b 30 5d 29 3b |gth(patt|ern[0]);|
|00002ff0| 20 20 2f 2f 20 6e 6f 74 | 65 3a 20 75 73 65 73 20 | // not|e: uses |
|00003000| 6c 65 6e 67 74 68 20 6f | 66 20 66 69 72 73 74 20 |length o|f first |
|00003010| 72 6f 77 20 61 73 20 6d | 61 78 20 77 69 64 74 68 |row as m|ax width|
|00003020| 20 6f 66 20 70 61 74 74 | 65 72 6e 0d 09 09 09 69 | of patt|ern....i|
|00003030| 66 20 78 32 2b 78 6c 65 | 6e 20 3e 20 73 69 7a 65 |f x2+xle|n > size|
|00003040| 58 0d 09 09 09 74 68 65 | 6e 20 78 6c 65 6e 20 3a |X....the|n xlen :|
|00003050| 3d 20 73 69 7a 65 58 20 | 2d 20 78 32 20 2b 20 31 |= sizeX |- x2 + 1|
|00003060| 3b 20 2f 2f 20 63 6c 69 | 70 20 70 61 74 74 65 72 |; // cli|p patter|
|00003070| 6e 20 61 74 20 72 69 67 | 68 74 0d 09 09 09 78 32 |n at rig|ht....x2|
|00003080| 20 3a 3d 20 78 32 20 2b | 20 78 6c 65 6e 20 2d 20 | := x2 +| xlen - |
|00003090| 31 3b 0d 09 09 09 66 6f | 72 20 79 20 3a 3d 20 30 |1;....fo|r y := 0|
|000030a0| 20 74 6f 20 79 6c 65 6e | 2d 31 0d 09 09 09 64 6f | to ylen|-1....do|
|000030b0| 20 62 65 67 69 6e 0d 09 | 09 09 09 72 6c 65 6e 20 | begin..|...rlen |
|000030c0| 3a 3d 20 6d 69 6e 28 6c | 65 6e 67 74 68 28 70 61 |:= min(l|ength(pa|
|000030d0| 74 74 65 72 6e 5b 79 5d | 29 2c 78 6c 65 6e 29 3b |ttern[y]|),xlen);|
|000030e0| 20 2f 2f 20 6c 65 6e 20 | 6f 66 20 63 75 72 72 65 | // len |of curre|
|000030f0| 6e 74 20 72 6f 77 20 69 | 6e 20 70 61 74 74 65 72 |nt row i|n patter|
|00003100| 6e 0d 09 09 09 09 69 66 | 20 6e 6f 74 20 28 72 6f |n.....if| not (ro|
|00003110| 77 20 3a 3d 20 75 6e 69 | 76 65 72 73 65 5b 63 6c |w := uni|verse[cl|
|00003120| 69 63 6b 59 20 2b 20 79 | 5d 29 20 20 2f 2f 20 63 |ickY + y|]) // c|
|00003130| 72 65 61 74 65 20 72 6f | 77 20 69 66 20 6e 65 63 |reate ro|w if nec|
|00003140| 65 73 73 61 72 79 0d 09 | 09 09 09 74 68 65 6e 20 |essary..|...then |
|00003150| 75 6e 69 76 65 72 73 65 | 5b 63 6c 69 63 6b 59 2b |universe|[clickY+|
|00003160| 79 5d 20 3a 3d 20 72 6f | 77 20 3a 3d 20 3a 6d 61 |y] := ro|w := :ma|
|00003170| 6b 65 52 6f 77 28 29 3b | 0d 09 09 09 09 41 72 72 |keRow();|.....Arr|
|00003180| 61 79 4d 75 6e 67 65 72 | 28 72 6f 77 2c 63 6c 69 |ayMunger|(row,cli|
|00003190| 63 6b 58 2c 72 6c 65 6e | 2c 70 61 74 74 65 72 6e |ckX,rlen|,pattern|
|000031a0| 5b 79 5d 2c 30 2c 72 6c | 65 6e 29 3b 20 2f 2f 20 |[y],0,rl|en); // |
|000031b0| 63 6f 70 79 20 72 6f 77 | 0d 09 09 09 09 65 6e 64 |copy row|.....end|
|000031c0| 3b 0d 09 09 09 65 6e 64 | 0d 0d 09 09 65 6c 73 65 |;....end|....else|
|000031d0| 20 2f 2f 20 61 64 64 20 | 61 20 64 6f 74 0d 09 09 | // add |a dot...|
|000031e0| 09 69 66 20 72 6f 77 20 | 3a 3d 20 75 6e 69 76 65 |.if row |:= unive|
|000031f0| 72 73 65 5b 63 6c 69 63 | 6b 59 5d 20 2f 2f 20 72 |rse[clic|kY] // r|
|00003200| 6f 77 20 65 78 69 73 74 | 73 3f 0d 09 09 74 68 65 |ow exist|s?...the|
|00003210| 6e 20 72 6f 77 5b 63 6c | 69 63 6b 58 5d 20 3a 3d |n row[cl|ickX] :=|
|00003220| 20 31 20 2d 20 72 6f 77 | 5b 63 6c 69 63 6b 58 5d | 1 - row|[clickX]|
|00003230| 20 2f 2f 20 74 6f 67 67 | 6c 65 20 64 6f 74 20 69 | // togg|le dot i|
|00003240| 6e 20 65 78 69 73 74 69 | 6e 67 20 72 6f 77 0d 09 |n existi|ng row..|
|00003250| 09 65 6c 73 65 20 62 65 | 67 69 6e 20 2f 2f 20 61 |.else be|gin // a|
|00003260| 64 64 20 74 6f 20 6e 65 | 77 20 72 6f 77 0d 09 09 |dd to ne|w row...|
|00003270| 09 75 6e 69 76 65 72 73 | 65 5b 63 6c 69 63 6b 59 |.univers|e[clickY|
|00003280| 5d 20 3a 3d 20 72 6f 77 | 20 3a 3d 20 3a 6d 61 6b |] := row| := :mak|
|00003290| 65 52 6f 77 28 29 3b 20 | 2f 2f 20 77 61 73 6e 27 |eRow(); |// wasn'|
|000032a0| 74 20 61 6c 6c 6f 63 61 | 74 65 64 20 79 65 74 0d |t alloca|ted yet.|
|000032b0| 09 09 09 72 6f 77 5b 63 | 6c 69 63 6b 58 5d 20 3a |...row[c|lickX] :|
|000032c0| 3d 20 31 3b 0d 09 09 09 | 65 6e 64 3b 0d 0d 09 09 |= 1;....|end;....|
|000032d0| 2f 2f 20 65 78 70 61 6e | 64 20 6c 69 76 65 20 61 |// expan|d live a|
|000032e0| 72 65 61 0d 09 09 66 69 | 72 73 74 52 6f 77 20 3a |rea...fi|rstRow :|
|000032f0| 3d 20 69 66 20 66 69 72 | 73 74 52 6f 77 20 74 68 |= if fir|stRow th|
|00003300| 65 6e 20 6d 69 6e 28 66 | 69 72 73 74 52 6f 77 2c |en min(f|irstRow,|
|00003310| 63 6c 69 63 6b 59 29 20 | 65 6c 73 65 20 63 6c 69 |clickY) |else cli|
|00003320| 63 6b 59 3b 0d 09 09 6c | 61 73 74 52 6f 77 20 20 |ckY;...l|astRow |
|00003330| 3a 3d 20 69 66 20 6c 61 | 73 74 52 6f 77 20 20 74 |:= if la|stRow t|
|00003340| 68 65 6e 20 6d 61 78 28 | 6c 61 73 74 52 6f 77 2c |hen max(|lastRow,|
|00003350| 79 32 29 20 20 65 6c 73 | 65 20 79 32 3b 0d 09 09 |y2) els|e y2;...|
|00003360| 66 69 72 73 74 43 6f 6c | 20 3a 3d 20 69 66 20 66 |firstCol| := if f|
|00003370| 69 72 73 74 43 6f 6c 20 | 74 68 65 6e 20 6d 69 6e |irstCol |then min|
|00003380| 28 66 69 72 73 74 43 6f | 6c 2c 63 6c 69 63 6b 58 |(firstCo|l,clickX|
|00003390| 29 20 65 6c 73 65 20 63 | 6c 69 63 6b 58 3b 0d 09 |) else c|lickX;..|
|000033a0| 09 6c 61 73 74 43 6f 6c | 20 20 3a 3d 20 69 66 20 |.lastCol| := if |
|000033b0| 6c 61 73 74 43 6f 6c 20 | 20 74 68 65 6e 20 6d 61 |lastCol | then ma|
|000033c0| 78 28 6c 61 73 74 43 6f | 6c 2c 78 32 29 20 20 65 |x(lastCo|l,x2) e|
|000033d0| 6c 73 65 20 78 32 3b 0d | 09 09 65 6e 64 3b 0d 0d |lse x2;.|..end;..|
|000033e0| 09 3a 44 69 72 74 79 28 | 29 3b 20 2f 2f 20 72 65 |.:Dirty(|); // re|
|000033f0| 74 75 72 6e 73 20 74 72 | 75 65 0d 09 65 6e 64 0d |turns tr|ue..end.|
|00003400| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0d 4c 69 66 65 2b |--------|--.Life+|
|00003410| 74 69 74 6c 65 4f 62 6a | 0d 7b 2f 2f 20 74 69 74 |titleObj|.{// tit|
|00003420| 6c 65 20 61 74 20 74 6f | 70 20 28 75 73 65 73 20 |le at to|p (uses |
|00003430| 4c 69 66 65 2e 74 69 74 | 6c 65 29 0d 5f 70 72 6f |Life.tit|le)._pro|
|00003440| 74 6f 3a 20 27 70 72 6f | 74 6f 54 69 74 6c 65 2c |to: 'pro|toTitle,|
|00003450| 0d 7d 0d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 0d 42 75 |.}.-----|-----.Bu|
|00003460| 74 74 6f 6e 42 6f 75 6e | 64 73 0d 66 75 6e 63 28 |ttonBoun|ds.func(|
|00003470| 77 69 64 74 68 29 0d 2f | 2f 20 75 73 65 64 20 66 |width)./|/ used f|
|00003480| 6f 72 20 61 64 64 69 6e | 67 20 65 6d 62 65 64 64 |or addin|g embedd|
|00003490| 65 64 20 62 75 74 74 6f | 6e 73 20 74 6f 20 73 74 |ed butto|ns to st|
|000034a0| 61 74 75 73 0d 2f 2f 20 | 74 68 69 73 20 69 73 20 |atus.// |this is |
|000034b0| 64 65 66 69 6e 65 64 20 | 61 73 20 61 20 4e 65 77 |defined |as a New|
|000034c0| 74 20 64 65 76 65 6c 6f | 70 6d 65 6e 74 2d 74 69 |t develo|pment-ti|
|000034d0| 6d 65 20 6d 65 74 68 6f | 64 0d 2f 2f 20 6f 6e 63 |me metho|d.// onc|
|000034e0| 65 20 74 68 65 20 62 75 | 74 74 6f 6e 73 20 61 72 |e the bu|ttons ar|
|000034f0| 65 20 69 6e 69 74 69 61 | 6c 69 7a 65 64 20 61 6e |e initia|lized an|
|00003500| 64 20 61 64 64 65 64 20 | 74 6f 20 73 74 61 74 75 |d added |to statu|
|00003510| 73 2c 0d 2f 2f 20 69 74 | 20 72 65 61 6c 6c 79 20 |s,.// it| really |
|00003520| 69 73 6e 27 74 20 6e 65 | 65 64 65 64 20 61 6e 79 |isn't ne|eded any|
|00003530| 6d 6f 72 65 20 61 6e 64 | 20 69 73 6e 27 74 20 73 |more and| isn't s|
|00003540| 61 76 65 64 20 77 69 74 | 68 20 74 68 65 20 61 70 |aved wit|h the ap|
|00003550| 70 0d 62 65 67 69 6e 0d | 09 6c 6f 63 61 6c 20 6c |p.begin.|.local l|
|00003560| 65 66 74 31 3a 3d 32 35 | 2c 20 74 6f 70 3a 3d 32 |eft1:=25|, top:=2|
|00003570| 2c 20 73 70 61 63 69 6e | 67 3a 3d 36 2c 20 62 6f |, spacin|g:=6, bo|
|00003580| 74 74 6f 6d 3a 3d 31 35 | 3b 0d 09 69 66 20 77 69 |ttom:=15|;..if wi|
|00003590| 64 74 68 20 3e 20 30 0d | 09 74 68 65 6e 20 53 65 |dth > 0.|.then Se|
|000035a0| 74 42 6f 75 6e 64 73 28 | 73 70 61 63 69 6e 67 2c |tBounds(|spacing,|
|000035b0| 20 20 74 6f 70 2c 20 73 | 70 61 63 69 6e 67 20 2b | top, s|pacing +|
|000035c0| 20 77 69 64 74 68 2c 20 | 62 6f 74 74 6f 6d 29 20 | width, |bottom) |
|000035d0| 20 20 2f 2f 20 6f 74 68 | 65 72 20 62 75 74 74 6f | // oth|er butto|
|000035e0| 6e 73 0d 09 65 6c 73 65 | 20 53 65 74 42 6f 75 6e |ns..else| SetBoun|
|000035f0| 64 73 28 6c 65 66 74 31 | 2c 20 20 20 20 74 6f 70 |ds(left1|, top|
|00003600| 2c 20 6c 65 66 74 31 20 | 2d 20 77 69 64 74 68 2c |, left1 |- width,|
|00003610| 20 20 20 62 6f 74 74 6f | 6d 29 3b 20 20 2f 2f 20 | botto|m); // |
|00003620| 66 69 72 73 74 20 62 75 | 74 74 6f 6e 0d 65 6e 64 |first bu|tton.end|
|00003630| 0d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0d 4c 69 66 65 |.-------|---.Life|
|00003640| 2b 73 74 61 74 75 73 0d | 7b 2f 2f 73 74 61 74 75 |+status.|{//statu|
|00003650| 73 20 62 61 72 20 77 69 | 74 68 20 63 6c 6f 63 6b |s bar wi|th clock|
|00003660| 20 61 6e 64 20 63 6c 6f | 73 65 62 6f 78 0d 5f 70 | and clo|sebox._p|
|00003670| 72 6f 74 6f 3a 20 27 70 | 72 6f 74 6f 53 74 61 74 |roto: 'p|rotoStat|
|00003680| 75 73 2c 0d 7d 0d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |us,.}.--|--------|
|00003690| 0d 4c 69 66 65 2e 73 74 | 61 74 75 73 2b 63 6c 65 |.Life.st|atus+cle|
|000036a0| 61 72 42 75 74 74 6f 6e | 0d 7b 5f 70 72 6f 74 6f |arButton|.{_proto|
|000036b0| 3a 20 27 70 72 6f 74 6f | 54 65 78 74 42 75 74 74 |: 'proto|TextButt|
|000036c0| 6f 6e 2c 0d 76 69 65 77 | 42 6f 75 6e 64 73 3a 20 |on,.view|Bounds: |
|000036d0| 3a 42 75 74 74 6f 6e 42 | 6f 75 6e 64 73 28 2d 34 |:ButtonB|ounds(-4|
|000036e0| 30 29 2c 20 2f 2f 20 66 | 69 72 73 74 20 62 75 74 |0), // f|irst but|
|000036f0| 74 6f 6e 20 28 73 74 65 | 70 63 68 69 6c 64 29 20 |ton (ste|pchild) |
|00003700| 69 6e 20 73 74 61 74 75 | 73 20 61 72 65 61 0d 74 |in statu|s area.t|
|00003710| 65 78 74 3a 20 22 43 6c | 65 61 72 22 2c 0d 62 75 |ext: "Cl|ear",.bu|
|00003720| 74 74 6f 6e 43 6c 69 63 | 6b 53 63 72 69 70 74 3a |ttonClic|kScript:|
|00003730| 20 66 75 6e 63 28 29 20 | 3a 63 6c 65 61 72 28 29 | func() |:clear()|
|00003740| 2c 0d 7d 0d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 4c |,.}.----|------.L|
|00003750| 69 66 65 2e 73 74 61 74 | 75 73 2b 6e 65 78 74 42 |ife.stat|us+nextB|
|00003760| 75 74 74 6f 6e 0d 7b 5f | 70 72 6f 74 6f 3a 20 27 |utton.{_|proto: '|
|00003770| 70 72 6f 74 6f 54 65 78 | 74 42 75 74 74 6f 6e 2c |protoTex|tButton,|
|00003780| 0d 76 69 65 77 42 6f 75 | 6e 64 73 3a 20 3a 42 75 |.viewBou|nds: :Bu|
|00003790| 74 74 6f 6e 42 6f 75 6e | 64 73 28 34 30 29 2c 20 |ttonBoun|ds(40), |
|000037a0| 2f 2f 20 73 65 63 6f 6e | 64 20 62 75 74 74 6f 6e |// secon|d button|
|000037b0| 0d 76 69 65 77 4a 75 73 | 74 69 66 79 3a 20 38 33 |.viewJus|tify: 83|
|000037c0| 38 39 36 33 38 2c 20 2f | 2f 20 76 6a 50 61 72 65 |89638, /|/ vjPare|
|000037d0| 6e 74 4c 65 66 74 48 20 | 2b 20 76 6a 50 61 72 65 |ntLeftH |+ vjPare|
|000037e0| 6e 74 54 6f 70 56 20 2b | 20 76 6a 53 69 62 6c 69 |ntTopV +| vjSibli|
|000037f0| 6e 67 52 69 67 68 74 48 | 20 2b 20 6f 6e 65 4c 69 |ngRightH| + oneLi|
|00003800| 6e 65 4f 6e 6c 79 20 2b | 20 76 6a 43 65 6e 74 65 |neOnly +| vjCente|
|00003810| 72 48 20 2b 20 76 6a 43 | 65 6e 74 65 72 56 2c 0d |rH + vjC|enterV,.|
|00003820| 74 65 78 74 3a 20 22 4e | 65 78 74 22 2c 0d 62 75 |text: "N|ext",.bu|
|00003830| 74 74 6f 6e 43 6c 69 63 | 6b 53 63 72 69 70 74 3a |ttonClic|kScript:|
|00003840| 20 66 75 6e 63 28 29 20 | 3a 6e 65 78 74 47 65 6e | func() |:nextGen|
|00003850| 65 72 61 74 69 6f 6e 28 | 29 2c 0d 7d 0d 2d 2d 2d |eration(|),.}.---|
|00003860| 2d 2d 2d 2d 2d 2d 2d 0d | 4c 69 66 65 2e 73 74 61 |-------.|Life.sta|
|00003870| 74 75 73 2b 72 65 70 65 | 61 74 42 75 74 74 6f 6e |tus+repe|atButton|
|00003880| 0d 7b 5f 70 72 6f 74 6f | 3a 20 27 70 72 6f 74 6f |.{_proto|: 'proto|
|00003890| 54 65 78 74 42 75 74 74 | 6f 6e 2c 0d 76 69 65 77 |TextButt|on,.view|
|000038a0| 42 6f 75 6e 64 73 3a 20 | 3a 42 75 74 74 6f 6e 42 |Bounds: |:ButtonB|
|000038b0| 6f 75 6e 64 73 28 34 30 | 29 2c 20 2f 2f 20 74 68 |ounds(40|), // th|
|000038c0| 69 72 64 20 62 75 74 74 | 6f 6e 0d 76 69 65 77 4a |ird butt|on.viewJ|
|000038d0| 75 73 74 69 66 79 3a 20 | 38 33 38 39 36 33 38 2c |ustify: |8389638,|
|000038e0| 0d 74 65 78 74 3a 20 22 | 52 65 70 65 61 74 22 2c |.text: "|Repeat",|
|000038f0| 0d 62 75 74 74 6f 6e 43 | 6c 69 63 6b 53 63 72 69 |.buttonC|lickScri|
|00003900| 70 74 3a 20 66 75 6e 63 | 28 29 0d 09 69 66 20 66 |pt: func|()..if f|
|00003910| 69 72 73 74 52 6f 77 0d | 09 74 68 65 6e 20 69 66 |irstRow.|.then if|
|00003920| 20 73 74 6f 70 70 65 64 | 0d 09 09 74 68 65 6e 20 | stopped|...then |
|00003930| 62 65 67 69 6e 0d 09 09 | 09 4c 69 66 65 3a 73 65 |begin...|.Life:se|
|00003940| 74 75 70 49 64 6c 65 28 | 64 65 6c 61 79 4d 73 65 |tupIdle(|delayMse|
|00003950| 63 73 29 3b 20 2f 2f 20 | 73 74 61 72 74 20 62 61 |cs); // |start ba|
|00003960| 63 6b 67 72 6f 75 6e 64 | 20 70 72 6f 63 65 73 73 |ckground| process|
|00003970| 0d 09 09 09 73 74 6f 70 | 70 65 64 20 3a 3d 20 4e |....stop|ped := N|
|00003980| 49 4c 3b 0d 09 09 09 53 | 65 74 56 61 6c 75 65 28 |IL;....S|etValue(|
|00003990| 73 65 6c 66 2c 27 74 65 | 78 74 2c 22 53 74 6f 70 |self,'te|xt,"Stop|
|000039a0| 22 29 3b 0d 09 09 09 65 | 6e 64 0d 09 09 65 6c 73 |");....e|nd...els|
|000039b0| 65 20 62 65 67 69 6e 0d | 09 09 09 4c 69 66 65 3a |e begin.|...Life:|
|000039c0| 73 65 74 75 70 49 64 6c | 65 28 30 29 3b 20 2f 2f |setupIdl|e(0); //|
|000039d0| 20 68 61 6c 74 20 62 61 | 63 6b 67 72 6f 75 6e 64 | halt ba|ckground|
|000039e0| 20 70 72 6f 63 65 73 73 | 0d 09 09 09 73 74 6f 70 | process|....stop|
|000039f0| 70 65 64 20 3a 3d 20 54 | 52 55 45 3b 0d 09 09 09 |ped := T|RUE;....|
|00003a00| 53 65 74 56 61 6c 75 65 | 28 73 65 6c 66 2c 27 74 |SetValue|(self,'t|
|00003a10| 65 78 74 2c 22 52 65 70 | 65 61 74 22 29 3b 0d 09 |ext,"Rep|eat");..|
|00003a20| 09 09 4c 69 66 65 44 72 | 61 77 3a 44 69 72 74 79 |..LifeDr|aw:Dirty|
|00003a30| 28 29 3b 20 2f 2f 20 72 | 65 64 72 61 77 20 74 6f |(); // r|edraw to|
|00003a40| 20 6d 61 6b 65 20 67 72 | 69 64 20 76 69 73 69 62 | make gr|id visib|
|00003a50| 6c 65 0d 09 09 09 65 6e | 64 2c 0d 7d 0d 2d 2d 2d |le....en|d,.}.---|
|00003a60| 2d 2d 2d 2d 2d 2d 2d 0d | 4c 69 66 65 2b 70 61 74 |-------.|Life+pat|
|00003a70| 74 65 72 6e 50 69 63 6b | 65 72 0d 7b 2f 2f 61 20 |ternPick|er.{//a |
|00003a80| 70 69 63 6b 65 72 20 66 | 6f 72 20 70 72 65 2d 62 |picker f|or pre-b|
|00003a90| 75 69 6c 74 20 70 61 74 | 74 65 72 6e 73 0d 5f 70 |uilt pat|terns._p|
|00003aa0| 72 6f 74 6f 3a 20 27 70 | 72 6f 74 6f 4c 61 62 65 |roto: 'p|rotoLabe|
|00003ab0| 6c 50 69 63 6b 65 72 2c | 0d 76 69 65 77 42 6f 75 |lPicker,|.viewBou|
|00003ac0| 6e 64 73 3a 20 52 65 6c | 42 6f 75 6e 64 73 28 32 |nds: Rel|Bounds(2|
|00003ad0| 2c 20 2d 33 32 2c 20 31 | 34 30 2c 20 31 36 29 2c |, -32, 1|40, 16),|
|00003ae0| 0d 76 69 65 77 4a 75 73 | 74 69 66 79 3a 20 38 33 |.viewJus|tify: 83|
|00003af0| 38 38 37 33 36 2c 20 2f | 2f 20 76 6a 4c 65 66 74 |88736, /|/ vjLeft|
|00003b00| 48 20 2b 20 76 6a 50 61 | 72 65 6e 74 42 6f 74 74 |H + vjPa|rentBott|
|00003b10| 6f 6d 56 20 2b 20 6f 6e | 65 4c 69 6e 65 4f 6e 6c |omV + on|eLineOnl|
|00003b20| 79 2c 0d 70 61 74 74 65 | 72 6e 73 3a 20 5b 2f 2f |y,.patte|rns: [//|
|00003b30| 20 6f 72 64 65 72 20 6d | 61 74 63 68 65 73 20 6e | order m|atches n|
|00003b40| 61 6d 65 73 20 69 6e 20 | 6c 61 62 65 6c 43 6f 6d |ames in |labelCom|
|00003b50| 6d 61 6e 64 73 0d 09 4e | 49 4c 2c 20 20 20 20 20 |mands..N|IL, |
|00003b60| 20 20 20 20 2f 2f 20 6e | 6f 6e 65 3d 64 6f 74 0d | // n|one=dot.|
|00003b70| 09 4e 49 4c 2c 20 20 20 | 20 20 20 20 20 20 2f 2f |.NIL, | //|
|00003b80| 20 6d 65 6e 75 20 73 65 | 70 61 72 61 74 6f 72 20 | menu se|parator |
|00003b90| 6c 69 6e 65 20 2d 2d 2d | 2d 2d 2d 2d 2d 0d 09 5b |line ---|-----..[|
|00003ba0| 5b 30 2c 31 2c 30 2c 5d | 2c 20 20 20 2f 2f 20 67 |[0,1,0,]|, // g|
|00003bb0| 6c 69 64 65 72 20 28 6e | 6f 74 65 3a 20 31 73 74 |lider (n|ote: 1st|
|00003bc0| 20 6c 69 6e 65 20 6f 66 | 20 70 61 74 74 65 72 6e | line of| pattern|
|00003bd0| 20 73 68 6f 75 6c 64 20 | 62 65 20 6d 61 78 20 77 | should |be max w|
|00003be0| 69 64 74 68 20 28 70 61 | 64 20 72 69 67 68 74 20 |idth (pa|d right |
|00003bf0| 77 69 74 68 20 30 73 20 | 69 66 20 6e 65 63 29 0d |with 0s |if nec).|
|00003c00| 09 20 5b 31 2c 5d 2c 20 | 20 20 20 20 20 20 2f 2f |. [1,], | //|
|00003c10| 20 20 20 73 75 62 73 65 | 71 75 65 6e 74 20 72 6f | subse|quent ro|
|00003c20| 77 73 20 63 61 6e 20 6f | 6d 69 74 20 74 72 61 69 |ws can o|mit trai|
|00003c30| 6c 69 6e 67 20 30 73 0d | 09 20 5b 31 2c 31 2c 31 |ling 0s.|. [1,1,1|
|00003c40| 2c 5d 5d 2c 0d 09 5b 5b | 31 2c 31 2c 31 2c 5d 5d |,]],..[[|1,1,1,]]|
|00003c50| 2c 20 20 2f 2f 20 62 6c | 69 6e 6b 65 72 0d 09 5b |, // bl|inker..[|
|00003c60| 5b 31 2c 31 5d 2c 20 20 | 20 20 20 20 2f 2f 20 62 |[1,1], | // b|
|00003c70| 6c 6f 63 6b 0d 09 20 5b | 31 2c 31 5d 5d 2c 0d 09 |lock.. [|1,1]],..|
|00003c80| 5b 5b 30 2c 31 2c 31 2c | 30 2c 5d 2c 20 2f 2f 20 |[[0,1,1,|0,], // |
|00003c90| 62 65 65 68 69 76 65 0d | 09 20 5b 31 2c 30 2c 30 |beehive.|. [1,0,0|
|00003ca0| 2c 31 2c 5d 2c 0d 09 20 | 5b 30 2c 31 2c 31 2c 5d |,1,],.. |[0,1,1,]|
|00003cb0| 5d 2c 0d 09 5d 2c 0d 6c | 61 62 65 6c 43 6f 6d 6d |],..],.l|abelComm|
|00003cc0| 61 6e 64 73 3a 20 5b 22 | 3c 64 6f 74 3e 22 2c 27 |ands: ["|<dot>",'|
|00003cd0| 70 69 63 6b 53 65 70 61 | 72 61 74 6f 72 2c 20 22 |pickSepa|rator, "|
|00003ce0| 67 6c 69 64 65 72 22 2c | 20 22 62 6c 69 6e 6b 65 |glider",| "blinke|
|00003cf0| 72 22 2c 20 22 62 6c 6f | 63 6b 22 2c 20 22 62 65 |r", "blo|ck", "be|
|00003d00| 65 68 69 76 65 22 2c 5d | 2c 0d 6c 61 62 65 6c 41 |ehive",]|,.labelA|
|00003d10| 63 74 69 6f 6e 53 63 72 | 69 70 74 3a 20 66 75 6e |ctionScr|ipt: fun|
|00003d20| 63 28 69 29 0d 09 70 61 | 74 74 65 72 6e 20 3a 3d |c(i)..pa|ttern :=|
|00003d30| 20 70 61 74 74 65 72 6e | 73 5b 69 5d 2c 20 2f 2f | pattern|s[i], //|
|00003d40| 20 66 6f 72 20 75 73 65 | 20 69 6e 20 76 69 65 77 | for use| in view|
|00003d50| 43 6c 69 63 6b 53 63 72 | 69 70 74 0d 74 65 78 74 |ClickScr|ipt.text|
|00003d60| 53 65 74 75 70 3a 20 66 | 75 6e 63 28 29 20 2f 2f |Setup: f|unc() //|
|00003d70| 20 6e 61 6d 65 20 6f 66 | 20 63 75 72 72 65 6e 74 | name of| current|
|00003d80| 20 70 61 74 74 65 72 6e | 0d 09 6c 61 62 65 6c 43 | pattern|..labelC|
|00003d90| 6f 6d 6d 61 6e 64 73 5b | 41 72 72 61 79 50 6f 73 |ommands[|ArrayPos|
|00003da0| 28 70 61 74 74 65 72 6e | 73 2c 70 61 74 74 65 72 |(pattern|s,patter|
|00003db0| 6e 2c 30 2c 6e 69 6c 29 | 5d 2c 0d 7d 0d 2d 2d 2d |n,0,nil)|],.}.---|
|00003dc0| 2d 2d 2d 2d 2d 2d 2d 0d | 4c 69 66 65 2b 6e 75 6d |-------.|Life+num|
|00003dd0| 47 65 6e 0d 7b 2f 2f 20 | 61 20 67 65 6e 65 72 61 |Gen.{// |a genera|
|00003de0| 74 69 6f 6e 20 63 6f 75 | 6e 74 65 72 0d 5f 70 72 |tion cou|nter._pr|
|00003df0| 6f 74 6f 3a 20 27 70 72 | 6f 74 6f 53 74 61 74 69 |oto: 'pr|otoStati|
|00003e00| 63 54 65 78 74 2c 0d 76 | 69 65 77 42 6f 75 6e 64 |cText,.v|iewBound|
|00003e10| 73 3a 20 52 65 6c 42 6f | 75 6e 64 73 28 31 38 30 |s: RelBo|unds(180|
|00003e20| 2c 2d 33 32 2c 35 30 2c | 31 36 29 2c 20 2f 2f 20 |,-32,50,|16), // |
|00003e30| 63 65 6e 74 65 72 65 64 | 2c 20 6a 75 73 74 20 61 |centered|, just a|
|00003e40| 62 6f 76 65 20 73 74 61 | 74 75 73 20 62 61 72 0d |bove sta|tus bar.|
|00003e50| 76 69 65 77 4a 75 73 74 | 69 66 79 3a 20 38 33 38 |viewJust|ify: 838|
|00003e60| 38 37 33 36 2c 20 20 2f | 2f 20 76 6a 4c 65 66 74 |8736, /|/ vjLeft|
|00003e70| 48 20 2b 20 76 6a 50 61 | 72 65 6e 74 42 6f 74 74 |H + vjPa|rentBott|
|00003e80| 6f 6d 56 20 2b 20 6f 6e | 65 4c 69 6e 65 4f 6e 6c |omV + on|eLineOnl|
|00003e90| 79 0d 74 65 78 74 3a 20 | 22 47 65 6e 3a 20 30 22 |y.text: |"Gen: 0"|
|00003ea0| 2c 0d 7d 0d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 4c |,.}.----|------.L|
|00003eb0| 69 66 65 2e 68 65 6c 70 | 53 74 75 66 66 7e 0d 7b |ife.help|Stuff~.{|
|00003ec0| 2f 2f 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 4c 69 |// addit|ional Li|
|00003ed0| 66 65 20 6d 65 74 68 6f | 64 73 20 74 6f 20 73 75 |fe metho|ds to su|
|00003ee0| 70 70 6f 72 74 20 68 65 | 6c 70 20 62 6f 6f 6b 0d |pport he|lp book.|
|00003ef0| 68 65 6c 70 42 6f 6f 6b | 3a 20 64 65 65 70 63 6c |helpBook|: deepcl|
|00003f00| 6f 6e 65 28 68 65 6c 70 | 42 6f 6f 6b 54 65 6d 70 |one(help|BookTemp|
|00003f10| 6c 61 74 65 29 2c 20 2f | 2f 20 63 6f 70 79 20 66 |late), /|/ copy f|
|00003f20| 72 6f 6d 20 4e 65 77 74 | 0d 68 65 6c 70 56 69 65 |rom Newt|.helpVie|
|00003f30| 77 3a 20 4e 49 4c 2c 0d | 0d 6f 70 65 6e 48 65 6c |w: NIL,.|.openHel|
|00003f40| 70 3a 20 66 75 6e 63 28 | 29 0d 09 69 66 20 68 65 |p: func(|)..if he|
|00003f50| 6c 70 42 6f 6f 6b 0d 09 | 74 68 65 6e 20 62 65 67 |lpBook..|then beg|
|00003f60| 69 6e 0d 09 09 69 66 20 | 6e 6f 74 20 68 65 6c 70 |in...if |not help|
|00003f70| 56 69 65 77 0d 09 09 74 | 68 65 6e 20 68 65 6c 70 |View...t|hen help|
|00003f80| 56 69 65 77 20 3a 3d 20 | 42 75 69 6c 64 43 6f 6e |View := |BuildCon|
|00003f90| 74 65 78 74 28 0d 09 09 | 09 7b 5f 70 72 6f 74 6f |text(...|.{_proto|
|00003fa0| 3a 20 47 65 74 52 6f 6f | 74 28 29 2e 54 69 6e 79 |: GetRoo|t().Tiny|
|00003fb0| 54 69 6d 2e 5f 70 72 6f | 74 6f 2c 0d 09 09 09 62 |Tim._pro|to,....b|
|00003fc0| 6f 6f 6b 52 65 66 3a 20 | 68 65 6c 70 42 6f 6f 6b |ookRef: |helpBook|
|00003fd0| 7d 29 3b 0d 09 09 47 65 | 74 52 6f 6f 74 28 29 2e |});...Ge|tRoot().|
|00003fe0| 54 69 6e 79 54 69 6d 3a | 43 6c 6f 73 65 28 29 3b |TinyTim:|Close();|
|00003ff0| 20 20 20 2f 2f 20 69 6e | 20 63 61 73 65 20 73 79 | // in| case sy|
|00004000| 73 74 65 6d 20 68 65 6c | 70 20 69 73 20 6f 70 65 |stem hel|p is ope|
|00004010| 6e 0d 09 09 68 65 6c 70 | 56 69 65 77 3a 6f 70 65 |n...help|View:ope|
|00004020| 6e 4d 61 6e 75 61 6c 28 | 68 65 6c 70 42 6f 6f 6b |nManual(|helpBook|
|00004030| 29 3b 0d 09 09 65 6e 64 | 2c 0d 0d 76 69 65 77 51 |);...end|,..viewQ|
|00004040| 75 69 74 53 63 72 69 70 | 74 3a 20 66 75 6e 63 28 |uitScrip|t: func(|
|00004050| 29 0d 09 62 65 67 69 6e | 0d 09 69 66 20 68 65 6c |)..begin|..if hel|
|00004060| 70 56 69 65 77 20 74 68 | 65 6e 20 68 65 6c 70 56 |pView th|en helpV|
|00004070| 69 65 77 3a 63 6c 6f 73 | 65 28 29 3b 0d 09 68 65 |iew:clos|e();..he|
|00004080| 6c 70 56 69 65 77 20 3a | 3d 20 4e 49 4c 3b 0d 09 |lpView :|= NIL;..|
|00004090| 65 6e 64 2c 0d 7d 0d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |end,.}.-|--------|
|000040a0| 2d 0d 4c 69 66 65 2e 73 | 74 61 74 75 73 2b 7a 69 |-.Life.s|tatus+zi|
|000040b0| 6e 66 6f 42 75 74 74 6f | 6e 0d 7b 5f 70 72 6f 74 |nfoButto|n.{_prot|
|000040c0| 6f 3a 20 27 70 72 6f 74 | 6f 54 65 78 74 42 75 74 |o: 'prot|oTextBut|
|000040d0| 74 6f 6e 2c 0d 76 69 65 | 77 42 6f 75 6e 64 73 3a |ton,.vie|wBounds:|
|000040e0| 20 3a 42 75 74 74 6f 6e | 42 6f 75 6e 64 73 28 34 | :Button|Bounds(4|
|000040f0| 30 29 2c 20 2f 2f 20 66 | 6f 75 72 74 68 20 62 75 |0), // f|ourth bu|
|00004100| 74 74 6f 6e 20 28 7a 69 | 6e 66 6f 20 73 6f 72 74 |tton (zi|nfo sort|
|00004110| 73 20 34 74 68 29 0d 76 | 69 65 77 4a 75 73 74 69 |s 4th).v|iewJusti|
|00004120| 66 79 3a 20 38 33 38 39 | 36 33 38 2c 0d 74 65 78 |fy: 8389|638,.tex|
|00004130| 74 3a 20 22 49 6e 66 6f | 22 2c 0d 62 75 74 74 6f |t: "Info|",.butto|
|00004140| 6e 43 6c 69 63 6b 53 63 | 72 69 70 74 3a 20 66 75 |nClickSc|ript: fu|
|00004150| 6e 63 28 29 20 3a 6f 70 | 65 6e 48 65 6c 70 28 29 |nc() :op|enHelp()|
|00004160| 2c 20 2f 2f 20 6f 70 65 | 6e 20 68 65 6c 70 20 62 |, // ope|n help b|
|00004170| 6f 6f 6b 0d 7d 0d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ook.}.--|--------|
|00004180| 0d 4c 69 66 65 2e 68 65 | 6c 70 42 6f 6f 6b 2b 70 |.Life.he|lpBook+p|
|00004190| 61 67 65 31 0d 2e 23 20 | 66 69 72 73 74 20 68 65 |age1..# |first he|
|000041a0| 6c 70 20 62 6f 6f 6b 20 | 70 61 67 65 0d 2e 73 75 |lp book |page..su|
|000041b0| 62 6a 65 63 74 20 31 0d | 44 65 73 63 72 69 62 65 |bject 1.|Describe|
|000041c0| 20 4c 69 66 65 0d 2e 73 | 74 6f 72 79 0d 4c 69 66 | Life..s|tory.Lif|
|000041d0| 65 20 69 73 20 61 20 6d | 61 74 68 65 6d 61 74 69 |e is a m|athemati|
|000041e0| 63 61 6c 20 67 61 6d 65 | 20 62 79 20 4a 6f 68 6e |cal game| by John|
|000041f0| 20 43 6f 6e 77 61 79 20 | 64 65 73 63 72 69 62 65 | Conway |describe|
|00004200| 64 20 6f 72 69 67 69 6e | 61 6c 6c 79 20 69 6e 20 |d origin|ally in |
|00004210| 53 63 69 65 6e 74 69 66 | 69 63 20 41 6d 65 72 69 |Scientif|ic Ameri|
|00004220| 63 61 6e 20 69 6e 20 4f | 63 74 2e 20 31 39 37 30 |can in O|ct. 1970|
|00004230| 2e 0d 0d 43 65 6c 6c 73 | 20 69 6e 20 74 68 65 20 |...Cells| in the |
|00004240| 63 75 72 72 65 6e 74 20 | 67 65 6e 65 72 61 74 69 |current |generati|
|00004250| 6f 6e 20 61 72 65 20 65 | 78 61 6d 69 6e 65 64 20 |on are e|xamined |
|00004260| 73 69 6d 75 6c 74 61 6e | 65 6f 75 73 6c 79 20 69 |simultan|eously i|
|00004270| 6e 20 6f 72 64 65 72 20 | 74 6f 20 63 72 65 61 74 |n order |to creat|
|00004280| 65 20 74 68 65 20 6e 65 | 78 74 20 67 65 6e 65 72 |e the ne|xt gener|
|00004290| 61 74 69 6f 6e 20 75 73 | 69 6e 67 20 74 68 65 20 |ation us|ing the |
|000042a0| 66 6f 6c 6c 6f 77 69 6e | 67 20 72 75 6c 65 73 3a |followin|g rules:|
|000042b0| 0d 2d 20 53 75 72 76 69 | 76 61 6c 3a 20 41 20 63 |.- Survi|val: A c|
|000042c0| 65 6c 6c 20 77 69 74 68 | 20 32 20 6f 72 20 33 20 |ell with| 2 or 3 |
|000042d0| 6e 65 69 67 68 62 6f 72 | 73 20 73 75 72 76 69 76 |neighbor|s surviv|
|000042e0| 65 73 2e 0d 2d 20 44 65 | 61 74 68 3a 20 41 20 63 |es..- De|ath: A c|
|000042f0| 65 6c 6c 20 77 69 74 68 | 20 31 20 6f 72 20 6c 65 |ell with| 1 or le|
|00004300| 73 73 2c 20 6f 72 20 34 | 20 6f 72 20 6d 6f 72 65 |ss, or 4| or more|
|00004310| 20 6e 65 69 67 68 62 6f | 72 73 2c 20 22 64 69 65 | neighbo|rs, "die|
|00004320| 73 22 2e 0d 2d 20 42 69 | 72 74 68 3a 20 41 6e 20 |s"..- Bi|rth: An |
|00004330| 65 6d 70 74 79 20 63 65 | 6c 6c 20 77 69 74 68 20 |empty ce|ll with |
|00004340| 65 78 61 63 74 6c 79 20 | 33 20 6e 65 69 67 68 62 |exactly |3 neighb|
|00004350| 6f 72 73 20 77 69 6c 6c | 20 62 65 20 22 62 6f 72 |ors will| be "bor|
|00004360| 6e 22 2e 0d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 4c |n"..----|------.L|
|00004370| 69 66 65 2e 68 65 6c 70 | 42 6f 6f 6b 2b 70 61 67 |ife.help|Book+pag|
|00004380| 65 32 0d 2e 73 75 62 6a | 65 63 74 20 31 0d 55 6e |e2..subj|ect 1.Un|
|00004390| 64 65 72 73 74 61 6e 64 | 20 74 68 65 20 43 6f 64 |derstand| the Cod|
|000043a0| 65 0d 2e 73 74 6f 72 79 | 0d 54 68 69 73 20 76 65 |e..story|.This ve|
|000043b0| 72 73 69 6f 6e 20 6f 66 | 20 4c 69 66 65 20 61 64 |rsion of| Life ad|
|000043c0| 64 73 20 6f 62 6a 65 63 | 74 73 2c 20 6d 65 74 68 |ds objec|ts, meth|
|000043d0| 6f 64 73 20 61 6e 64 20 | 6f 70 74 69 6d 69 7a 61 |ods and |optimiza|
|000043e0| 74 69 6f 6e 73 20 74 6f | 20 61 6e 20 69 6d 70 6c |tions to| an impl|
|000043f0| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 64 69 73 63 75 |ementati|on discu|
|00004400| 73 73 65 64 20 69 6e 20 | 22 4c 69 66 65 20 77 69 |ssed in |"Life wi|
|00004410| 74 68 20 4e 65 77 74 6f | 6e 53 63 72 69 70 74 22 |th Newto|nScript"|
|00004420| 20 62 79 20 44 61 76 69 | 64 20 42 65 74 7a 20 69 | by Davi|d Betz i|
|00004430| 6e 20 42 79 74 65 2c 20 | 4d 61 72 63 68 20 31 39 |n Byte, |March 19|
|00004440| 39 34 2c 20 70 70 2e 20 | 31 39 31 2d 31 39 34 2e |94, pp. |191-194.|
|00004450| 0d 0d 41 73 20 61 20 70 | 72 65 63 75 72 73 6f 72 |..As a p|recursor|
|00004460| 2f 61 6c 74 65 72 6e 61 | 74 69 76 65 20 74 6f 20 |/alterna|tive to |
|00004470| 62 75 79 69 6e 67 20 41 | 50 44 41 27 73 20 4e 65 |buying A|PDA's Ne|
|00004480| 77 74 6f 6e 20 54 6f 6f | 6c 4b 69 74 20 28 4e 54 |wton Too|lKit (NT|
|00004490| 4b 29 2c 20 79 6f 75 20 | 63 6f 75 6c 64 20 72 65 |K), you |could re|
|000044a0| 67 69 73 74 65 72 20 66 | 6f 72 20 4e 65 77 74 20 |gister f|or Newt |
|000044b0| 28 73 65 65 20 44 65 76 | 65 6c 6f 70 29 20 74 6f |(see Dev|elop) to|
|000044c0| 20 6f 62 74 61 69 6e 20 | 61 20 6d 61 6e 75 61 6c | obtain |a manual|
|000044d0| 20 61 6e 64 20 6d 6f 72 | 65 20 4e 65 77 74 6f 6e | and mor|e Newton|
|000044e0| 53 63 72 69 70 74 20 61 | 70 70 6c 69 63 61 74 69 |Script a|pplicati|
|000044f0| 6f 6e 20 65 78 61 6d 70 | 6c 65 73 2e 0d 2d 2d 2d |on examp|les..---|
|00004500| 2d 2d 2d 2d 2d 2d 2d 0d | 4c 69 66 65 2e 68 65 6c |-------.|Life.hel|
|00004510| 70 42 6f 6f 6b 2b 70 61 | 67 65 33 0d 2e 73 75 62 |pBook+pa|ge3..sub|
|00004520| 6a 65 63 74 20 31 0d 44 | 69 73 74 72 69 62 75 74 |ject 1.D|istribut|
|00004530| 65 0d 2e 73 74 6f 72 79 | 0d 54 68 69 73 20 76 65 |e..story|.This ve|
|00004540| 72 73 69 6f 6e 20 6f 66 | 20 4c 69 66 65 20 69 73 |rsion of| Life is|
|00004550| 20 66 72 65 65 77 61 72 | 65 20 61 6e 64 20 6d 61 | freewar|e and ma|
|00004560| 79 20 62 65 20 64 69 73 | 74 72 69 62 75 74 65 64 |y be dis|tributed|
|00004570| 20 66 72 65 65 6c 79 20 | 61 73 20 6c 6f 6e 67 20 | freely |as long |
|00004580| 61 73 20 74 68 65 20 66 | 69 6c 65 20 22 6c 69 66 |as the f|ile "lif|
|00004590| 65 2e 6e 77 74 22 20 69 | 73 20 69 6e 63 6c 75 64 |e.nwt" i|s includ|
|000045a0| 65 64 20 61 6e 64 20 75 | 6e 6d 6f 64 69 66 69 65 |ed and u|nmodifie|
|000045b0| 64 2e 20 20 59 6f 75 20 | 61 72 65 20 66 72 65 65 |d. You |are free|
|000045c0| 20 74 6f 20 6d 61 6b 65 | 20 6d 6f 64 69 66 69 63 | to make| modific|
|000045d0| 61 74 69 6f 6e 73 20 66 | 6f 72 20 79 6f 75 72 20 |ations f|or your |
|000045e0| 6f 77 6e 20 75 73 65 2e | 0d 0d 43 6f 70 79 72 69 |own use.|..Copyri|
|000045f0| 67 68 74 20 31 39 39 34 | 20 53 2e 20 57 65 79 65 |ght 1994| S. Weye|
|00004600| 72 2e 20 41 6c 6c 20 52 | 69 67 68 74 73 20 52 65 |r. All R|ights Re|
|00004610| 73 65 72 76 65 64 20 57 | 6f 72 6c 64 77 69 64 65 |served W|orldwide|
|00004620| 2e 0d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 4c 69 66 |..------|----.Lif|
|00004630| 65 2e 68 65 6c 70 42 6f | 6f 6b 2b 70 61 67 65 34 |e.helpBo|ok+page4|
|00004640| 0d 2e 73 75 62 6a 65 63 | 74 20 31 0d 55 73 65 0d |..subjec|t 1.Use.|
|00004650| 2e 73 74 6f 72 79 0d 5c | 75 46 43 30 31 5c 75 20 |.story.\|uFC01\u |
|00004660| 70 61 74 74 65 72 6e 20 | 2d 2d 20 73 65 6c 65 63 |pattern |-- selec|
|00004670| 74 20 61 20 70 61 74 74 | 65 72 6e 0d 0d 3c 74 61 |t a patt|ern..<ta|
|00004680| 70 3e 20 69 6e 20 63 65 | 6c 6c 20 61 72 65 61 20 |p> in ce|ll area |
|00004690| 74 6f 20 61 64 64 20 61 | 20 70 61 74 74 65 72 6e |to add a| pattern|
|000046a0| 2c 20 6f 72 20 61 64 64 | 2f 72 65 6d 6f 76 65 20 |, or add|/remove |
|000046b0| 69 6e 64 69 76 69 64 75 | 61 6c 20 63 65 6c 6c 73 |individu|al cells|
|000046c0| 0d 0d 43 6c 65 61 72 20 | 2d 2d 20 63 6c 65 61 72 |..Clear |-- clear|
|000046d0| 20 61 6c 6c 20 63 65 6c | 6c 73 2c 20 72 65 73 65 | all cel|ls, rese|
|000046e0| 74 20 67 65 6e 2e 20 63 | 6f 75 6e 74 65 72 0d 0d |t gen. c|ounter..|
|000046f0| 4e 65 78 74 20 20 2d 2d | 20 65 76 6f 6c 76 65 20 |Next --| evolve |
|00004700| 61 20 73 69 6e 67 6c 65 | 20 67 65 6e 65 72 61 74 |a single| generat|
|00004710| 69 6f 6e 0d 0d 52 65 70 | 65 61 74 20 2d 2d 20 65 |ion..Rep|eat -- e|
|00004720| 76 6f 6c 76 65 20 75 6e | 74 69 6c 20 61 6c 6c 20 |volve un|til all |
|00004730| 63 65 6c 6c 73 20 61 72 | 65 20 65 6d 70 74 79 20 |cells ar|e empty |
|00004740| 6f 72 20 79 6f 75 20 74 | 61 70 20 53 74 6f 70 0d |or you t|ap Stop.|
|00004750| 0d 49 6e 66 6f 20 2d 2d | 20 6f 70 65 6e 20 74 68 |.Info --| open th|
|00004760| 69 73 20 68 65 6c 70 20 | 62 6f 6f 6b 0d 2d 2d 2d |is help |book.---|
|00004770| 2d 2d 2d 2d 2d 2d 2d 0d | 4c 69 66 65 2e 68 65 6c |-------.|Life.hel|
|00004780| 70 42 6f 6f 6b 2b 70 61 | 67 65 35 0d 2e 73 75 62 |pBook+pa|ge5..sub|
|00004790| 6a 65 63 74 20 31 0d 44 | 65 76 65 6c 6f 70 0d 2e |ject 1.D|evelop..|
|000047a0| 73 74 6f 72 79 0d 49 66 | 20 79 6f 75 20 61 72 65 |story.If| you are|
|000047b0| 20 69 6e 74 65 72 65 73 | 74 65 64 20 69 6e 20 6f | interes|ted in o|
|000047c0| 62 6a 65 63 74 2d 6f 72 | 69 65 6e 74 65 64 20 70 |bject-or|iented p|
|000047d0| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 69 6e 20 4e 65 |rogrammi|ng in Ne|
|000047e0| 77 74 6f 6e 53 63 72 69 | 70 74 2c 20 64 65 76 65 |wtonScri|pt, deve|
|000047f0| 6c 6f 70 69 6e 67 20 61 | 70 70 6c 69 63 61 74 69 |loping a|pplicati|
|00004800| 6f 6e 73 20 6f 6e 20 79 | 6f 75 72 20 4e 65 77 74 |ons on y|our Newt|
|00004810| 6f 6e 2c 20 6f 72 20 67 | 72 61 70 68 69 63 61 6c |on, or g|raphical|
|00004820| 20 28 74 75 72 74 6c 65 | 29 20 65 6e 76 69 72 6f | (turtle|) enviro|
|00004830| 6e 6d 65 6e 74 73 2c 20 | 74 72 79 20 6d 79 20 73 |nments, |try my s|
|00004840| 68 61 72 65 77 61 72 65 | 20 73 68 61 72 65 77 61 |hareware| sharewa|
|00004850| 72 65 20 64 65 76 65 6c | 6f 70 6d 65 6e 74 20 65 |re devel|opment e|
|00004860| 6e 76 69 72 6f 6e 6d 65 | 6e 74 20 22 4e 65 77 74 |nvironme|nt "Newt|
|00004870| 22 20 28 6e 65 77 74 2d | 64 65 76 65 6e 76 2d 32 |" (newt-|devenv-2|
|00004880| 34 2e 73 69 74 2f 2e 7a | 69 70 2f 2e 68 71 78 20 |4.sit/.z|ip/.hqx |
|00004890| 6f 6e 20 75 69 6f 77 61 | 2c 20 61 6d 75 67 2c 20 |on uiowa|, amug, |
|000048a0| 41 4f 4c 2c 20 65 57 6f | 72 6c 64 3b 20 6e 65 77 |AOL, eWo|rld; new|
|000048b0| 74 32 34 2e 73 69 74 2f | 2e 7a 69 70 20 6f 6e 20 |t24.sit/|.zip on |
|000048c0| 43 49 53 29 2e 0d 0d 52 | 65 67 69 73 74 65 72 65 |CIS)...R|egistere|
|000048d0| 64 20 75 73 65 72 73 20 | 72 65 63 65 69 76 65 20 |d users |receive |
|000048e0| 61 20 6d 61 6e 75 61 6c | 20 61 6e 64 20 61 20 66 |a manual| and a f|
|000048f0| 6c 6f 70 70 79 20 6f 66 | 20 73 65 76 65 72 61 6c |loppy of| several|
|00004900| 20 64 6f 7a 65 6e 20 65 | 78 61 6d 70 6c 65 73 20 | dozen e|xamples |
|00004910| 69 6e 63 6c 75 64 69 6e | 67 20 4c 69 66 65 20 28 |includin|g Life (|
|00004920| 73 65 76 65 72 61 6c 20 | 76 65 72 73 69 6f 6e 73 |several |versions|
|00004930| 29 2e 0d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 0d 4c 69 |)..-----|-----.Li|
|00004940| 66 65 2e 68 65 6c 70 42 | 6f 6f 6b 2b 70 61 67 65 |fe.helpB|ook+page|
|00004950| 36 0d 2e 73 75 62 6a 65 | 63 74 20 31 0d 43 6f 6e |6..subje|ct 1.Con|
|00004960| 74 61 63 74 20 41 75 74 | 68 6f 72 0d 2e 73 74 6f |tact Aut|hor..sto|
|00004970| 72 79 0d 53 74 65 70 68 | 65 6e 20 57 65 79 65 72 |ry.Steph|en Weyer|
|00004980| 0d 31 37 20 54 69 6d 62 | 65 72 20 4b 6e 6f 6c 6c |.17 Timb|er Knoll|
|00004990| 20 44 72 69 76 65 0d 57 | 61 73 68 69 6e 67 74 6f | Drive.W|ashingto|
|000049a0| 6e 20 43 72 6f 73 73 69 | 6e 67 2c 20 50 41 20 31 |n Crossi|ng, PA 1|
|000049b0| 38 39 37 37 2d 31 30 35 | 32 0d 49 6e 74 65 72 6e |8977-105|2.Intern|
|000049c0| 65 74 3a 20 77 65 79 65 | 72 40 67 75 65 73 74 2e |et: weye|r@guest.|
|000049d0| 61 70 70 6c 65 2e 63 6f | 6d 0d 41 6d 65 72 69 63 |apple.co|m.Americ|
|000049e0| 61 20 4f 6e 6c 69 6e 65 | 2c 20 65 57 6f 72 6c 64 |a Online|, eWorld|
|000049f0| 2c 20 4e 65 77 74 6f 6e | 4d 61 69 6c 3a 20 53 74 |, Newton|Mail: St|
|00004a00| 65 76 65 57 65 79 65 72 | 0d 43 6f 6d 70 75 73 65 |eveWeyer|.Compuse|
|00004a10| 72 76 65 3a 20 37 34 36 | 30 33 2c 32 30 35 31 0d |rve: 746|03,2051.|
|00004a20| 41 70 70 6c 65 4c 69 6e | 6b 3a 20 57 45 59 45 52 |AppleLin|k: WEYER|
|00004a30| 2e 53 0d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 0d 42 59 |.S.-----|-----.BY|
|00004a40| 45 21 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |E!......|........|
|00004a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a80| 00 00 01 00 00 00 02 6c | 00 00 01 6c 00 00 00 32 |.......l|...l...2|
|00004a90| 2c 00 04 0c 47 00 01 66 | 0e 20 6e ff f8 3a 28 00 |,...G..f|. n..:(.|
|00004aa0| 06 3c 28 00 04 60 08 3a | 2b 00 0c 3c 2b 00 0e 08 |.<(..`.:|+..<+...|
|00004ab0| 0c 6c 69 66 65 2d 6d 61 | 63 2e 6e 77 74 3f 02 00 |.life-ma|c.nwt?..|
|00004ac0| 02 00 54 45 58 54 52 2a | 63 68 01 00 ff ff ff ff |..TEXTR*|ch......|
|00004ad0| 02 00 54 45 58 54 52 2a | 63 68 01 00 ff ff ff ff |..TEXTR*|ch......|
|00004ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004af0| 00 00 aa e4 c2 00 00 00 | 49 c3 00 00 02 9e 2c 00 |........|I.....,.|
|00004b00| 04 48 c0 2f 00 30 2c 00 | 06 48 c0 2f 00 48 c4 2f |.H./.0,.|.H./.H./|
|00004b10| 04 30 2e ff fe 48 c0 2f | 00 48 6c 00 10 4e ba 02 |.0...H./|.Hl..N..|
|00004b20| a4 4a 47 57 c3 44 03 48 | 83 48 c3 02 2c 00 df 00 |.JGW.D.H|.H..,...|
|00004b30| 19 eb 0b 02 03 00 20 87 | 2c 00 19 20 6b 00 08 10 |...... .|,.. k...|
|00004b40| 2e ff fd a0 6a 20 6e ff | f4 a0 2a 20 6e ff f4 a0 |....j n.|..* n...|
|00004b50| 49 30 07 4c ee 18 f8 ff | d8 4e 5e 4e 75 4e 56 ff |I0.L....|.N^NuNV.|
|00004b60| f8 48 e7 01 38 26 6e 00 | 08 42 47 48 6e ff f8 a8 |.H..8&n.|.BGHn...|
|00004b70| 74 20 6e ff f8 20 28 00 | 02 b0 b8 02 ae 67 10 37 |t n.. (.|.....g.7|
|00004b80| 00 00 01 68 52 2a 63 68 | 02 50 00 2b 00 05 02 2b |...hR*ch|.P.+...+|
|00004b90| 01 80 00 18 00 00 03 15 | 00 00 03 5c 00 00 00 00 |........|...\....|
|00004ba0| 00 04 00 09 00 00 06 4d | 6f 6e 61 63 6f 00 00 00 |.......M|onaco...|
|00004bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004be0| 00 00 00 00 00 00 03 00 | 00 03 00 00 00 48 00 48 |........|.....H.H|
|00004bf0| 00 00 00 00 02 da 02 28 | ff e1 ff e2 02 f9 02 46 |.......(|.......F|
|00004c00| 03 47 05 28 03 fc 00 02 | 00 00 00 48 00 48 00 00 |.G.(....|...H.H..|
|00004c10| 00 00 02 da 02 28 00 01 | 00 00 00 64 00 00 00 01 |.....(..|...d....|
|00004c20| 00 01 01 01 00 00 00 01 | 27 0f 00 01 00 01 00 00 |........|'.......|
|00004c30| 00 00 00 00 00 00 00 00 | 00 00 60 00 00 19 01 90 |........|..`.....|
|00004c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 01 |........|........|
|00004c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c60| 00 04 00 09 00 00 06 4d | 6f 6e 61 63 6f 08 00 00 |.......M|onaco...|
|00004c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ca0| 00 00 00 00 00 00 00 04 | 01 00 00 01 00 00 00 00 |........|........|
|00004cb0| 00 01 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 01 01 00 01 |........|........|
|00004ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 01 00 |........|........|
|00004cf0| 00 00 02 6c 00 00 01 6c | 00 00 00 32 01 18 ef ec |...l...l|...2....|
|00004d00| 10 e6 00 00 00 1c 00 32 | 00 00 42 42 53 52 00 00 |.......2|..BBSR..|
|00004d10| 00 0a 02 50 ff ff 00 00 | 00 00 01 18 ea 18 00 00 |...P....|........|
|00004d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+